hi all, I am working on a project which I wrote repeatedly "Sheets(x).Cells(i,n)" and "Sheets
.Cells(j,m)"
where x, y, n and m are constants, while i and j are loop variables.
After a while, I am lost on which is which. Hereby I want to create two variables, preferably named "targetCell" and "curCell" where
targetCell = Sheets(x).Cells(i,n)
curCell = Sheets
.Cells(j,m)
Is there anyway I can define those outside the loop so targetCell and curCell values changes whenever i and j changes?
I tried to search the forum with keyword "dynamic variables", but maybe I use the wrong keyword and did not found any good help. Please pardon me if this is a duplicate question and if anyone can provide a link to the post it will be great.
Thank you in advance for your help.
where x, y, n and m are constants, while i and j are loop variables.
After a while, I am lost on which is which. Hereby I want to create two variables, preferably named "targetCell" and "curCell" where
targetCell = Sheets(x).Cells(i,n)
curCell = Sheets
Is there anyway I can define those outside the loop so targetCell and curCell values changes whenever i and j changes?
I tried to search the forum with keyword "dynamic variables", but maybe I use the wrong keyword and did not found any good help. Please pardon me if this is a duplicate question and if anyone can provide a link to the post it will be great.
Thank you in advance for your help.