range selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi ,
"A:A, F:F, AC:AC". those 3 columns have a different numbers of rows in each file. let's say x identify the last row.
how do I now select this range to apply a specific format.

I though something like "A1:A" & x but this works only for one column.
How do I select all ?

thanks
douvid
 
Hi Douvid,

Is this what you want?

Dim sRange As String
sRange = "A1:A" & Cells(Rows.Count, "A").End(xlUp).Row & "," & _
"F1:F" & Cells(Rows.Count, "F").End(xlUp).Row & "," & _
"AC1:AC" & Cells(Rows.Count, "AC").End(xlUp).Row
Range(sRange).Select

--

HTH

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

douvid said:
Hi ,
"A:A, F:F, AC:AC". those 3 columns have a different numbers of rows in
each file. let's say x identify the last row.
 
one way:

With Range("A1:A" & x & ",F1:F" & x & ",AC1:AC" & x)
.Interior.ColorIndex = 3
.NumberFormat = "@"
.Font.ColorIndex = 6
End With
 
Back
Top