Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I want to create a range where the begin and end cells are specified by two other Range variables. For example, Set r1 = ActiveSheet.Range("C5") Set r2 = ActiveSheet.Range("E8") How can I define r3 to contain the range "C5:E8" using these two? Thanks in advance. -- PeterWilliams ------------------------------------------------------------------------ PeterWilliams's Profile: http://www.excelforum.com/member.php...o&userid=34438 View this thread: http://www.excelforum.com/showthread...hreadid=543547 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try this, but i wouldn't use r1 and r2, those are cell addresses
Sub test() Dim rng1 As Range, rng2 As Range, rng3 As Range Set rng1 = ActiveSheet.Range("C5") Set rng2 = ActiveSheet.Range("E8") Set rng3 = Range(rng1, rng2) rng3.Select End Sub Gary -- Gary "PeterWilliams" wrote in message news:PeterWilliams.280yom_1147992001.8847@excelfor um-nospam.com... Hi, I want to create a range where the begin and end cells are specified by two other Range variables. For example, Set r1 = ActiveSheet.Range("C5") Set r2 = ActiveSheet.Range("E8") How can I define r3 to contain the range "C5:E8" using these two? Thanks in advance. -- PeterWilliams ------------------------------------------------------------------------ PeterWilliams's Profile: http://www.excelforum.com/member.php...o&userid=34438 View this thread: http://www.excelforum.com/showthread...hreadid=543547 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating Ranges Easily | Excel Discussion (Misc queries) | |||
Creating cell ranges | Excel Programming | |||
Creating Non-Contiguous Cell Ranges | Excel Programming | |||
Creating Ranges | Excel Programming | |||
Creating Named Ranges in VBA | Excel Programming |