my macro opens and copy/paste a text file into excel.
This file represents transactions per a certain group. Actually 9 groups are present. On variable ranges, "Grand Totals" per group are present. Group names are 22-1, 22-2, 22-A etc. Now, what my macro does is using the Find method (dim myval / myval = "grand") and copy / paste the found area to another sheet. So far, so good.
However, what I've done to stop the loop is to define in the 'Do until..' statement that I tell the macro to fill in range("Z1") = 1 when the "Grand total" is found of group "22-9". I rather want this to be more flexible because it may happen that from tomorrow onwards the last group will not be "22-9" but maybe "22-10" or "22-X" or whatever.
Next to this, if found a grand-total group, it will copy / paste this to another sheet but rather than going to the "select sheet2, paste values, select sheet1 and move on" procedure I would like to use the copy destination:= statement but then I will have a conflict when the macro will copy paste for the first time (since the first time there is no defined destination cell in sheet2).
Attached the file with what I made of it.
Does anyone has a better idea?
Thanks in advance for your help.
P.S. since I'm a newbie here, it would be fair that - should you think that points to be gained - you advise me if the reward correspond with your findings.