ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   relative reference (https://www.excelbanter.com/excel-programming/280540-relative-reference.html)

Duce

relative reference
 
1) I use a macro to copy a range of cells (k9:n9) on the
active worksheet.
2) I select the leftmost cell to which I want paste the 4
values (values only). It always starts in the same
column, but the row is always different. I can paste
without incident.

What I would like to do is make a macro that pastes to
that manually selected cell and then simply moves over 5
cells to the right. When I do this the code is
always 'Range ("E95")' or some such so regardless of the
row I am on... the macro always ends on E95.

What do I code so as to get a relative reference? Is it
an r1c1 function?

Thanks,
Duce

steve

relative reference
 
Duce,

Maybe
Activecell.Offset(0,5) to designate 5 cells to the right.

--
sb
"Duce" wrote in message
...
1) I use a macro to copy a range of cells (k9:n9) on the
active worksheet.
2) I select the leftmost cell to which I want paste the 4
values (values only). It always starts in the same
column, but the row is always different. I can paste
without incident.

What I would like to do is make a macro that pastes to
that manually selected cell and then simply moves over 5
cells to the right. When I do this the code is
always 'Range ("E95")' or some such so regardless of the
row I am on... the macro always ends on E95.

What do I code so as to get a relative reference? Is it
an r1c1 function?

Thanks,
Duce





All times are GMT +1. The time now is 09:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com