lynnnow
06-10-2006, 09:33 AM
Hi,
I had seen a code here where the user can use the InputBox function to get a range.
This is the original code
Sub GetUserRange()
Dim UserRange As Range
Prompt = "Select a cell for the output."
Title = "Select a cell"
' Display the Input Box
On Error Resume Next
Set UserRange = Application.InputBox( _
Prompt:=Prompt, _
Title:=Title, _
Default:=ActiveCell.Address, _
Type:=8) 'Range selection
' Was the Input Box canceled?
If UserRange Is Nothing Then
MsgBox "Action Canceled"
Else
:
:
End If
End Sub
My problem is that i've not made any change to the set statement of the InputBox, however, the last two weeks has seen a change in the behavior of the code. The set statement always returns "Nothing" instead of the range I've selected. I've stepped through the code many times to check what is going wrong but fail to see any bug.:bug:
I've finally upgraded to Office 2003 on Win 2K.
Any help is appreciated.
T&R: pray2:
I had seen a code here where the user can use the InputBox function to get a range.
This is the original code
Sub GetUserRange()
Dim UserRange As Range
Prompt = "Select a cell for the output."
Title = "Select a cell"
' Display the Input Box
On Error Resume Next
Set UserRange = Application.InputBox( _
Prompt:=Prompt, _
Title:=Title, _
Default:=ActiveCell.Address, _
Type:=8) 'Range selection
' Was the Input Box canceled?
If UserRange Is Nothing Then
MsgBox "Action Canceled"
Else
:
:
End If
End Sub
My problem is that i've not made any change to the set statement of the InputBox, however, the last two weeks has seen a change in the behavior of the code. The set statement always returns "Nothing" instead of the range I've selected. I've stepped through the code many times to check what is going wrong but fail to see any bug.:bug:
I've finally upgraded to Office 2003 on Win 2K.
Any help is appreciated.
T&R: pray2: