ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiple selection (https://www.excelbanter.com/excel-programming/350180-multiple-selection.html)

David

Multiple selection
 
Hi, Group,

I want to select several different ranges to format them ie B2:E2 and
B11:EE11, but I am not certain of the syntax to selct them.

Thanks,
--
David

Norman Jones

Multiple selection
 
Hi David,

Try something like:

'=============
Public Sub Tester()
Dim rng As Range

Set rng = Range("B2:E2,B11:EE11")

'Format rng, e.g.:
rng.Interior.ColorIndex = 6

End Sub
'<<=============

Note that it is rarely necessary to select a range and such selections are
usually inefficient.


---
Regards,
Norman


"David" wrote in message
...
Hi, Group,

I want to select several different ranges to format them ie B2:E2 and
B11:EE11, but I am not certain of the syntax to selct them.

Thanks,
--
David





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

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