Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Why the following code produces an error? Public Sub aSub() Const msg1 = "Select input range" Const msg2 = "Select output cell" Dim WB As Workbook Dim SH As Worksheet Dim Rng As Range Dim destRng As Range Dim rngInput As Range, rngOutput As Range Set rngInput = Application.InputBox(msg1, Type:=8) Set rngOutput = Application.InputBox(msg2, Type:=8) If rngInput Is Nothing Then Exit Sub If rngOutput Is Nothing Then Exit Sub Set WB = ActiveWorkbook Set SH = WB.ActiveSheet Set Rng = SH.Range(rngInput) Set destRng = SH.Range(rngOutput) End Sub While if I change the last rows, for example Set Rng=SH.Range("B1:C1000") Set destRng = SH.Range("F2") it works I want to use the ranges selected with inputboxes, and not change the code! Where is the mistake? Thanks j. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can't Select Range off sheet from inputbox | Excel Discussion (Misc queries) | |||
InputBox method with range | Excel Programming | |||
Select range with InputBox. Is it possible? | Excel Programming | |||
Selecting a Range using Inputbox Method | Excel Programming | |||
Trying to return Range from InputBox | Excel Programming |