I have the user select a Range with the following:
Sub InputRange()
Dim varRange As Variant
On Error Resume Next
Set varRange = _
Application.InputBox("Select all cells in the row you would like to update", Type:=8)
If IsObject(varRange) = False Then Exit Sub
'just to show the range has been selected
MsgBox varRange.Cells.Address
End Sub
I then want to take the values from the fields in this range and use them to fill in a UserForm.
Or, if I could just somehow reference the address of the first cell in the selected range, then I could pass that address thru to my form as a starting location and use the offset functions to fill the form - but, I don't know how to get the first cell address or pass it along for use in another bit of code.
I am really new to this, and would appreciate any help.
Thanks!
Sub InputRange()
Dim varRange As Variant
On Error Resume Next
Set varRange = _
Application.InputBox("Select all cells in the row you would like to update", Type:=8)
If IsObject(varRange) = False Then Exit Sub
'just to show the range has been selected
MsgBox varRange.Cells.Address
End Sub
I then want to take the values from the fields in this range and use them to fill in a UserForm.
Or, if I could just somehow reference the address of the first cell in the selected range, then I could pass that address thru to my form as a starting location and use the offset functions to fill the form - but, I don't know how to get the first cell address or pass it along for use in another bit of code.
I am really new to this, and would appreciate any help.
Thanks!