ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extend Selection Question (https://www.excelbanter.com/excel-programming/416067-extend-selection-question.html)

Reitanos

Extend Selection Question
 
I know that I can extend the selection by address using
Activecell.Offset.Range("A1:B10").Select
but if I'm using a variable for the width is there a way to reference
that without having to calculate the column address (ie if I need to
select 28 columns starting in B)?

Thanks

Rick Rothstein \(MVP - VB\)[_2652_]

Extend Selection Question
 
Your question is not entirely clear. Are you extending an existing
selection? If so, you can do something like this...

Selection.Resize(, NewWidth).Select

This will work no matter what the size of the selection is. If that is not
your question, I'm still sure Resize is the answer... if you would clarify
what your starting situation is, we can show you how to apply Resize to it.

Rick


"Reitanos" wrote in message
...
I know that I can extend the selection by address using
Activecell.Offset.Range("A1:B10").Select
but if I'm using a variable for the width is there a way to reference
that without having to calculate the column address (ie if I need to
select 28 columns starting in B)?

Thanks



Reitanos

Extend Selection Question
 
You must have understood enough, because it worked. Thanks

On Aug 25, 1:02*pm, "Rick Rothstein \(MVP - VB\)"
wrote:
Your question is not entirely clear. Are you extending an existing
selection? If so, you can do something like this...

Selection.Resize(, NewWidth).Select

This will work no matter what the size of the selection is. If that is not
your question, I'm still sure Resize is the answer... if you would clarify
what your starting situation is, we can show you how to apply Resize to it.



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

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