ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I select multiple selections using the range(cell(),Cell()) (https://www.excelbanter.com/excel-programming/377033-how-do-i-select-multiple-selections-using-range-cell-cell.html)

havocdragon

How do I select multiple selections using the range(cell(),Cell())
 
HI all.

I need to select for instance Range("B2:J2,E4:K4")

However this is going to be a dynamic selection process (for charts), and I
need to be able to use variables, which, for me, is much easier using the
Range(Cell(),Cell()) method.

Tom Ogilvy

How do I select multiple selections using the range(cell(),Cell())
 
Dim rng1 as Range, rng2 as Range
Dim rng3 as Range
set rng1 = Range(Cell(),Cell())
set rng2 = Range(Cell(),Cell())
set rng3 = Union(rng1,rng2)

--
Regards,
Tom Ogilvy

"havocdragon" wrote:

HI all.

I need to select for instance Range("B2:J2,E4:K4")

However this is going to be a dynamic selection process (for charts), and I
need to be able to use variables, which, for me, is much easier using the
Range(Cell(),Cell()) method.



All times are GMT +1. The time now is 11:36 PM.

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