ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Relative range references in VBA - how? (https://www.excelbanter.com/excel-programming/374480-relative-range-references-vba-how.html)

mike

Relative range references in VBA - how?
 
When I move a cell that gets info pasted to it via a macro, I have to
readjust the macro. Is there a way to make cell references in script be
relative like in the spreadsheet?

I thought of naming all the cells. I guess that would work, right?

Is there a way without using names?


Tom Ogilvy

Relative range references in VBA - how?
 
This isn't supported. Using Named Ranges would work.

If there will be label associated with an adjacent cell, then you could use
the find method to locate it.

--
Regards,
Tom Ogilvy


"mike" wrote:

When I move a cell that gets info pasted to it via a macro, I have to
readjust the macro. Is there a way to make cell references in script be
relative like in the spreadsheet?

I thought of naming all the cells. I guess that would work, right?

Is there a way without using names?




All times are GMT +1. The time now is 04:35 PM.

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