Directional macro [Closed]

Report
-
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
-
Hello,

I'm trying to figure out a macro here. Pretty much, I'm importing a lot of data into an excel spreadsheet and then I want to copy and paste specific info. Luckily, I am able to do the "find" function and position myself to the correct row. In that row, I want to copy 4 different cells and paste it in another sheet. So, I figure I can do a Selection.Offset (#,#).Select function to move to the correct cell on that row. However, I having some trouble figuring out how to continue moving to the right where ever I leave off at. For instance, I copy cell A in Sheet 1 and paste in Sheet 2, then I want to be able to move from cell A to cell B and so on...

It could be a matter of identifying the active cell? I'm not sure. Any suggestions??

-Thanks!

3 replies

Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
307
Hi
before pasting to a new sheet, just put the row and column number to variables and after pasting retrieve them
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Thanks, but I'm not sure how to turn the cells to variables. I'm pretty new with macros. Would I be assigning each row/column a variable? Or each cell? And then I would instruct the macro to go to the assigned variable? Do you know the written command for this off-hand?
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
307
Hi
"I am able to do the "find" function and position myself to the correct row. In that row, I want to copy 4 different cells and paste it in another sheet. "
Here when you are in the first cell to copy, put the current column to a variable and row number to another variable. then copy and paste the data. Then go to the cell whose reference you now stored in variables and go to the next cell copy and continue like that...
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!