Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How do I select this range using code?

Excel 2000
Windows 2k Pro


My StartCell is Range("B4").

My LastCell will be Range("E?") where the ? represents the last row
containing a value in either columns B through E.

-gk-



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default How do I select this range using code?

TBA,

Try this out:

range(range("B4"), Range("E" & Range("B4").CurrentRegion.Rows.count)).select

John

"TBA" wrote in message
...
Excel 2000
Windows 2k Pro


My StartCell is Range("B4").

My LastCell will be Range("E?") where the ? represents the last row
containing a value in either columns B through E.

-gk-





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do I select this range using code?

Although I am pretty sure someone comes up with a better way:
Sub SelectColumnE()
Dim B, E As Integer

Range("b65536").Select
Selection.End(xlUp).Select
B = Selection.Row

Range("e65536").Select
Selection.End(xlUp).Select
E = Selection.Row

If B = E Then Range("e" & B).Select
If B < E Then Range("e" & E).Select

End Sub

Per Erik

On Wed, 14 Jan 2004 10:51:03 -0600, "TBA"
wrote:

Excel 2000
Windows 2k Pro


My StartCell is Range("B4").

My LastCell will be Range("E?") where the ? represents the last row
containing a value in either columns B through E.

-gk-



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
CODE 2 SELECT SHEETS LISTED IN A RANGE Faraz A. Qureshi Excel Discussion (Misc queries) 1 July 30th 09 07:31 AM
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Code to select range Shawn Excel Discussion (Misc queries) 1 June 2nd 05 05:14 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 10:24 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"