ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A1:B(xlDown)? (https://www.excelbanter.com/excel-programming/414704-a1-b-xldown.html)

Simon[_2_]

A1:B(xlDown)?
 
Hi,

I use

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select

for column A, but how do I grab from A1 to the last record in row B in
one swoop?

Mike Fogleman[_2_]

A1:B(xlDown)?
 
Dim rng As Range, LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
Set rng = Range("A1:B"& LastRow)

Mike F
"Simon" wrote in message
...
Hi,

I use

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select

for column A, but how do I grab from A1 to the last record in row B in
one swoop?




Wigi

A1:B(xlDown)?
 
Range("A1:B" & Range("B1").End(xlDown).Row)



--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Simon" wrote:

Hi,

I use

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select

for column A, but how do I grab from A1 to the last record in row B in
one swoop?


Bob Phillips

A1:B(xlDown)?
 
Range("A1").Resize(Range("A1").End(xlDown).Row).Se lect


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Simon" wrote in message
...
Hi,

I use

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select

for column A, but how do I grab from A1 to the last record in row B in
one swoop?




JMay

A1:B(xlDown)?
 
Needed to use
Range("A1").Resize(Range("B1").End(xlDown).Row, 2).Select

"Bob Phillips" wrote:

Range("A1").Resize(Range("A1").End(xlDown).Row).Se lect


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Simon" wrote in message
...
Hi,

I use

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select

for column A, but how do I grab from A1 to the last record in row B in
one swoop?





Simon[_2_]

A1:B(xlDown)?
 
On Jul 28, 11:43*am, JMay wrote:
Needed to use
Range("A1").Resize(Range("B1").End(xlDown).Row, 2).Select



"Bob Phillips" wrote:
Range("A1").Resize(Range("A1").End(xlDown).Row).Se lect


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"Simon" wrote in message
...
Hi,


I use


Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select


for column A, but how do I grab from A1 to the last record in row B in
one swoop?- Hide quoted text -


- Show quoted text -


Yes, thansk the ,2) was requred, specifing the number of rows required.


All times are GMT +1. The time now is 11:16 PM.

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