pingwong9r9r
New Member
- Joined
- May 3, 2017
- Messages
- 3
Hello,
I'm currently trying to write a macro which will accept user input for a range, where if only a single cell is selected, then the entire corresponding row to that cell is considered as the user input range, but I keep getting a 424 error with the following code:
I'm currently trying to write a macro which will accept user input for a range, where if only a single cell is selected, then the entire corresponding row to that cell is considered as the user input range, but I keep getting a 424 error with the following code:
Code:
Sub Calculations()
Dim UserRange As Range
Dim Result As Integer
Set UserRange = Application.InputBox("Select a range", "Record Selection", Type:=8)
Result = UserRange.EntireRow.Count
If Result = 1 Then
Set UserRange = UserRange.EntireRow.Select
End If
'... Perform calculations with user range
End Sub