ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   selectign a range (https://www.excelbanter.com/excel-programming/276635-selectign-range.html)

Maxtm8

selectign a range
 
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.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


John Wilson

selectign a range
 
Maxtm8,

Range(Range("B1"), Range("B65536").End(xlUp)).Select

John

Maxtm8 wrote:

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.

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Maxtm8[_2_]

selectign a range
 
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


steve

selectign a range
 
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")

--
sb
"Maxtm8" wrote in message
...
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.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 02:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com