selectign a range

  • Thread starter Thread starter Maxtm8
  • Start date Start date
M

Maxtm8

hi,

does anyone know, how to select range. for example, i am trying to
select values from first cell to the last cell in column B.
 
i found this one, and it works. thanks


Dim x As Long
x = Range("A" & Rows.Count).End(xlUp).Row
Range("a1:a" & x).Select
 
The rude and crude way

Dim lrow As Long

lrow = Cells(Rows.COUNT, "B").End(xlUp).Row
Range(Cells(1,2),Cells(lrow,2)).Select

But keep in mind that there are many things you can do with out selecting

For example
Range("A1").Select
Range("A1").Copy
Range("B1").Select
Range("B1").Paste
can be replaced with
Range("A1").Copy _
Destination:= Range("B1")
 
Back
Top