View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_700_] Leith Ross[_700_] is offline
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