excel macro relative reference problem?


Posted by Reid Adamson on December 15, 2000 7:07 AM

I want a macro that copies a value from one field to another column, then appends a "-01, -02" to this copied value. Seems fairly simple. When I run my macro it is copying the value from the starting cell where I wrote the macro(recorded keystrokes)and not on the cell that I've anchored the cursor to. I've tried lots of variations, but can't get it to work. Any suggestions would be appreciated.

Posted by Greg on December 15, 2000 1:52 PM

I think this is what you want. Example? value in a1 = 5 you want it to copy 5 to say A4 and add -01 to have the value 5-01 in A4. I think you are lookin for the activecell command. Activecell takes the value in the currently active cell. You can then put it in a variable and do what you want with it there.



Posted by Reid Adamson on December 19, 2000 6:47 AM

Thanks for the info, Greg, but I don't know how to deal with the information that you've given me. Would you please offer an example of this command and specifically how to "put it in a variable"? Thank you.