ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset Ranges (https://www.excelbanter.com/excel-programming/425583-offset-ranges.html)

Martin

Offset Ranges
 
How do you define a Range based on where the current ActiveCell to 5 Cells to
the Right? Obviously I don't know where the ActiveCell is either Column or
Row?

Thanks

Per Jessen

Offset Ranges
 
Hi

This should do what you want:

Set TargetRange = Range(ActiveCell, ActiveCell.Offset(0, 5))

Regards,
Per

"Martin" skrev i meddelelsen
...
How do you define a Range based on where the current ActiveCell to 5 Cells
to
the Right? Obviously I don't know where the ActiveCell is either Column or
Row?

Thanks



Martin

Offset Ranges
 
Per

Thanks, that pointed me in the right direction

Martin

"Per Jessen" wrote:

Hi

This should do what you want:

Set TargetRange = Range(ActiveCell, ActiveCell.Offset(0, 5))

Regards,
Per

"Martin" skrev i meddelelsen
...
How do you define a Range based on where the current ActiveCell to 5 Cells
to
the Right? Obviously I don't know where the ActiveCell is either Column or
Row?

Thanks





All times are GMT +1. The time now is 03:49 AM.

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