Relative Addressing---Need a Simple Solution


Posted by Elliott Reed on January 24, 2002 11:26 AM

I finally decided to upgrade to Excel 97
from Excel 4.0...so I'm rewriting macros.

I use a date macro =TEXT(NOW(),"m/d")
then using an adjacent cell I copy the
result using = and a cell reference.

The macro picks up the date text and
date stamps the line. This is the only
way I've found so the date stays as text
and doesn't change. Each day I open the
worksheet, the date changes to the next day.

My problem is referencing the cell and
copy and pasting it in macro. It seems
like I run into absolute address referencing
with the macros. I want to point, click, and
put a the date in the cell.

I know this is simple...that's why I can't
figure outhow to do it.

Thanks

Elliott



Posted by Dave S on January 24, 2002 11:43 AM

Elliot--

If you're recording a macro just press the little excel picture square button next to the stop button before recording. This records relative references rather than absolute references. Or, if the function was written by you, just use the offset command rather than stating specific cells. (ie: cells(1,1).offset(0,1).value)
Hope this helps.

Dave S