ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "Selection" Code??? (https://www.excelbanter.com/excel-programming/313879-selection-code.html)

elayem[_4_]

"Selection" Code???
 

Hi,
In my maco I current have a certain set of numbers selected. Is ther
any code to expand the selection to the cells in the two columns to th
left of this selection? i.e. if cells C1 to H4 were filled, but want A
to H4 selected, is this possible? Also, this was just an example,
don't want the code to specifically use these cells, just in genera
how to select the two columns that exist in front of my selection
Thanks

--
elaye
-----------------------------------------------------------------------
elayem's Profile: http://www.excelforum.com/member.php...fo&userid=1534
View this thread: http://www.excelforum.com/showthread.php?threadid=27015


Ron de Bruin

"Selection" Code???
 
Hi elayem

You can try this

Selection.Offset(, -2).Resize(, Selection.Columns.Count + 2).Select

--
Regards Ron de Bruin
http://www.rondebruin.nl


"elayem" wrote in message ...

Hi,
In my maco I current have a certain set of numbers selected. Is there
any code to expand the selection to the cells in the two columns to the
left of this selection? i.e. if cells C1 to H4 were filled, but want A1
to H4 selected, is this possible? Also, this was just an example, I
don't want the code to specifically use these cells, just in general
how to select the two columns that exist in front of my selection.
Thanks.


--
elayem
------------------------------------------------------------------------
elayem's Profile: http://www.excelforum.com/member.php...o&userid=15344
View this thread: http://www.excelforum.com/showthread...hreadid=270152





All times are GMT +1. The time now is 12:00 AM.

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