Hello Adam,
Sorry about getting back to you so late. I am not sure what you mean about the grouping structure. Could you give me an example?
I'll break down the code for you. LastRow is found by starting at the bottom of a column, in this case "A". VBA compares the next cell to the previous cell until they are different or the last cell in the range (A1:A65535) has been reached. Since it is starting at the bottom, cell A1 marks the end. The End method of a Range has 4 directions. It can go bottom to top (xlUp), top to bottom (xlDown), right to left (xlToLeft), or left to right (xlToRight).
MasterRng is a Range Object that is assigned to the range Worksheets("Master").Range("A2:B" & LastRow). Whenever VBA sees MasterRng, it knows we are referring to the Range("A2:B" & LastRow) on the Worksheet named "Master". It is a programming shortcut. Makes the code easier to read and maintain.
The Copy method of range has an Argument named Destination. If the argument is omitted, the data goes onto the clipboard, otherwise it is copied to the range you set destination to.
Sincerely,
Leith Ross
Bookmarks