Multiple Col. Selection

  • Thread starter Thread starter David Fixemer
  • Start date Start date
D

David Fixemer

Need a good way to select multiple columns using variables?

x=1 'column a
y=3 'column c

I would like to select column x and y but not column b?

David
 
Hi David,

Range(Cells(1, x), Cells(1, y)).EntireColumn.Select

is one way

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi
one way: try
....
dim rng_1 as range
dim rng_2 as range
set rng_1 = cells(1,x).entirecolumn
set rng_2 = cells(1,y).entirecolumn
....
 
David,

Yes it does, I missed the bit about column b. An adaptation of the method
(not necessarily the best way) is

Range(Cells(1, x).Address & "," & Cells(1,
y).Address).EntireColumn.Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top