Thread
:
Using "Cells" to write "Range("A:A,H:H").Select"
View Single Post
#
4
Posted to microsoft.public.excel.programming
Trip Ives[_2_]
external usenet poster
Posts: 3
Using "Cells" to write "Range("A:A,H:H").Select"
Thanks Guys!!
(Trip Ives) wrote in message om...
Hello all,
I'm trying to select two non-contigious columns but do not know the
position of the second column because it changes depending on the
user's input. Thus, I need to calculate the position of the second
column. Thus, using "Cells" makes this operation much easier.
I know that the following do not work as they select all columns
between - I only want the two end columns:
Range(Cells(1, 1), Cells(1, 8)).EntireColumn.Select
Range(Cells(1, 1), Cells(1, 8).EntireColumn).Select
Range(Cells(1, 1).EntireColumn, Cells(1, 8).EntireColumn).Select
The only other option I can think of is to calculate the column number
and then run it through a big case-statement to derive the column name
and then piece together the standard range syntax using variables.
But that seems rediculous.
Any thoughts?
Thanks!
Trip
Reply With Quote
Trip Ives[_2_]
View Public Profile
Find all posts by Trip Ives[_2_]