C
Chris Strug
Hi,
Something of a newbiw to Excel VBA so please excuse me if this is an obvious
question.
I have two sheets. One contains original data, the other essentially the
same data just ordered and formatted in a different way. Each row is
identified with a unique ID.
I require a function that will loop through each row of the source sheet,
find the matching row (using the ID) on the destination sheet and then do
the required formatting. However I'm unsure how to do the match, I've looked
at the vlookup worksheetfunction but I'm unsure how it handles not being
able to find the ID (i.e. the source row isn't on the destination).
The approach I have taken is:
' Find the last row of source data and assign it to variable.
for icount = 1 to lastrow
'lookup value in destination here
'if found do various things. not applicable to this question
next icount
What is the best practice for looking up the ID's between the two sheets?
Vlookup, find, programming loops, etc.
Any and all advice is gratefully received.
Kind thanks
Chris.
Something of a newbiw to Excel VBA so please excuse me if this is an obvious
question.
I have two sheets. One contains original data, the other essentially the
same data just ordered and formatted in a different way. Each row is
identified with a unique ID.
I require a function that will loop through each row of the source sheet,
find the matching row (using the ID) on the destination sheet and then do
the required formatting. However I'm unsure how to do the match, I've looked
at the vlookup worksheetfunction but I'm unsure how it handles not being
able to find the ID (i.e. the source row isn't on the destination).
The approach I have taken is:
' Find the last row of source data and assign it to variable.
for icount = 1 to lastrow
'lookup value in destination here
'if found do various things. not applicable to this question
next icount
What is the best practice for looking up the ID's between the two sheets?
Vlookup, find, programming loops, etc.
Any and all advice is gratefully received.
Kind thanks
Chris.