Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select range between column and row


Hello Robert H,

This method will combine find the end of each column and create a new
range with that includes the end of the columns.

Code:
--------------------

Sub RangeTest()

Dim Addx As String
Dim NewRng As Range
Dim Rng As Range

Set Rng = Range("H1,I1,J1,K1,L1,M1")

For Each Cell In Rng.Areas
If NewRng Is Nothing Then
Set NewRng = Range(Cell, Cell.End(xlDown))
Else
Set NewRng = Union(NewRng, Range(Cell, Cell.End(xlDown)))
End If
Next Cell

Addx = NewRng.Address

End Sub

--------------------

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=44959

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
select a range in a column jimbo Excel Discussion (Misc queries) 4 December 10th 09 11:46 AM
Select a range by column number David Andrews Excel Programming 2 June 9th 07 03:06 PM
Select column same row by range name Kevryl Excel Programming 1 August 1st 06 07:16 AM
Select a range in a column in currentregion ward376 Excel Programming 6 March 14th 06 02:25 PM
select a range base on Column A JUAN Excel Programming 3 July 27th 04 07:49 PM


All times are GMT +1. The time now is 05:30 AM.

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

About Us

"It's about Microsoft Excel"