ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Relative Values in a Macro (https://www.excelbanter.com/excel-programming/294527-relative-values-macro.html)

DGernand

Relative Values in a Macro
 
How do you select a range of cells with relative value instead of absolute values in a macro?

Rob van Gelder[_4_]

Relative Values in a Macro
 
This will select the cell in the next column:
Range("A1").Offset(0, 1).Select

This will select a region the same size as B5:G15 but offset 20 rows down.
Range("B5:G15").Offset(20, 0).Select



--
Rob van Gelder - http://www.vangelder.co.nz/excel


"DGernand" wrote in message
...
How do you select a range of cells with relative value instead of absolute

values in a macro?



Grey Newt

Relative Values in a Macro
 
If it helps - when you record a macro you can choose (using the small toolbar that appears during recording) to alter the selection from relative to absolute. you can then copy the recorded code into your procedure...


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

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