folks, i am working through a reformatting problem in another thread and came to a new problem along the way.
Find and Findnext:
in my active range, i set two variables to find.
from the positions in which these strings are found, i offset to gather certain values. These values are then pasted to a new sheet.
the code then resets (findsnext) the variables as below:
the theory being that the code then finds the next instance of the c variable and the next instance of the d variable, offsetting from those addresses to gather the next lot of values. this continues until the loop has gathered data from every page.
However, on resetting c, which should then find the next instance of "DEBT2.P33" in my active sheet, the variable becomes "Previous Months Adjustments:", which is the d variable.
Can you have more than one Find/FindNext pair in a macro?
Find and Findnext:
in my active range, i set two variables to find.
Code:
Set c = .Find("DEBT2.P33", LookIn:=xlValues) Set d = .Find("Previous Months Adjustments:", LookIn:=xlValues)
from the positions in which these strings are found, i offset to gather certain values. These values are then pasted to a new sheet.
the code then resets (findsnext) the variables as below:
Code:
Set c = .FindNext(c) Set d = .FindNext(d)
the theory being that the code then finds the next instance of the c variable and the next instance of the d variable, offsetting from those addresses to gather the next lot of values. this continues until the loop has gathered data from every page.
However, on resetting c, which should then find the next instance of "DEBT2.P33" in my active sheet, the variable becomes "Previous Months Adjustments:", which is the d variable.
Can you have more than one Find/FindNext pair in a macro?