Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamic range selection


if column b is empty but i want to select the cell in column b next to
the last cell with value in column a, how can i select the empty cell
in column b.


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

Thanks


--
JohnDK
------------------------------------------------------------------------
JohnDK's Profile: http://www.excelforum.com/member.php...fo&userid=7184
View this thread: http://www.excelforum.com/showthread...hreadid=485700

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default dynamic range selection

Try this

Sub test()
Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
Cells(lr, "B").Select
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"JohnDK" wrote in message
...

if column b is empty but i want to select the cell in column b next to
the last cell with value in column a, how can i select the empty cell
in column b.


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

Thanks


--
JohnDK
------------------------------------------------------------------------
JohnDK's Profile: http://www.excelforum.com/member.php...fo&userid=7184
View this thread: http://www.excelforum.com/showthread...hreadid=485700



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamic range selection


Ron, thanks, i appreciate it.

If i want to select the corresponding cell in column c as well how
would i have to change the column index to include that cell.?

Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
Cells(lr, "B").Select

???cells(lr,"B:C").Select???


--
JohnDK
------------------------------------------------------------------------
JohnDK's Profile: http://www.excelforum.com/member.php...fo&userid=7184
View this thread: http://www.excelforum.com/showthread...hreadid=485700

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default dynamic range selection

One way:

Sub test()
Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
Range(Cells(lr, "B"), Cells(lr, "C")).Select
End Sub

Regards
Rowan

JohnDK wrote:
Ron, thanks, i appreciate it.

If i want to select the corresponding cell in column c as well how
would i have to change the column index to include that cell.?

Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
Cells(lr, "B").Select

???cells(lr,"B:C").Select???


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Range Selection Using VBA TEK Excel Discussion (Misc queries) 2 January 23rd 10 04:55 AM
Need Help on Dynamic Range Selection anshu[_2_] Excel Discussion (Misc queries) 5 July 12th 07 07:52 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Dynamic range selection Fernando Ronci Excel Programming 1 August 4th 04 10:37 PM
Dynamic Range Selection Todd Huttenstine Excel Programming 4 May 5th 04 08:54 PM


All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"