Directional macro

Closed
kalignify - Jun 7, 2009 at 02:28 AM
Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 - Jun 8, 2009 at 06:14 AM
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 responses

Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 307
Jun 7, 2009 at 05:12 AM
Hi
before pasting to a new sheet, just put the row and column number to variables and after pasting retrieve them
1
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
Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 307
Jun 8, 2009 at 06:14 AM
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