VBA to copy and paste cells to scattered cells on another sheet

  • [ATTACH]n1202926[/ATTACH] I was sent this workbook. When the macro is run the cells on "Sheet1" are copied and pasted to various cells on sheet "Letter". Sheet "Map" has a table that specifies the from and to for each cell. It works great BUT, I can't understand HOW! The code identifies the From and To sheets, but I see no reference whatsoever to the sheet "Map" or it's table. Is something missing here, or I just don't understand what's going on? The code:

  • Hi rinconpaul,

    There is a named range called "From_Sheet" which has been set to cells A2:A9 of the Map tab. The code simply goes down this range and uses whatever is in Col. A to whatever is in Col. B i.e. Offset(0,1) per row to copy and paste respectively.



  • Ah Ha! very sneaky and unique way of doing things. Thankyou kindly for solving this mind game Robert. Now that I know, I can put it to good use.

  • Quote

    Ah Ha! very sneaky and unique way of doing things.

    I wouldn't go that far as I've seen it quite a bit and used the idea myself. You could also have a single cell for each tab so everything is driven from the Map tab.

    Glad we got it sorted.



Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!