Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stecher

macrumors newbie
Original poster
Feb 22, 2013
1
0
I don't know how to tell the macro recorder to use relative cell position rather than fixed. Anybody know where I should look?

Mike
 

blevins321

macrumors 68030
Dec 24, 2010
2,768
96
Detroit, MI
I don't know if there's an automated way to do that besides recording a formula being entered to convert to the row/column relative format. But you can manually code it.

Range("A1").Value ="Something"

Can turn into Cells(row#,col#) = "Something". You can do math inside there so if you want three rows over and one cell down you could do Cells(row() + 3, col# - 1) = "Something".

Hope that helps!
 

James_C

macrumors 68030
Sep 13, 2002
2,817
1,822
Bristol, UK
Mike, There is a relative reference button in the Developer Ribbon - See screenshot.

When this button is turned on, any Macro's created using the record button will use relative cell references.

Workbook1.png
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.