selectign a range

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.
 
M

Maxtm8

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
 
S

steve

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top