Hi
I am using an inputBox to get a value from a cell in excel. My variable gInput is not accepting the value from the range.
ub gAddDetail1()
Dim rng As Range
Dim gInput As Variant
'Get A Cell Address From The User to Get Number Format From
On Error Resume Next
Set rng = Application.InputBox( _
Title:="Data field from Cell", _
Prompt:="Select a cell to pull in your Data Field", _
Type:=8)
On Error GoTo 0
'Test to ensure User Did not cancel
If rng Is Nothing Then Exit Sub
'Set Variable to first cell in user's input
Set rng = rng.Cells(1, 1)
'Data Field
gInput = rng.Value
'
End Sub
I am using an inputBox to get a value from a cell in excel. My variable gInput is not accepting the value from the range.
ub gAddDetail1()
Dim rng As Range
Dim gInput As Variant
'Get A Cell Address From The User to Get Number Format From
On Error Resume Next
Set rng = Application.InputBox( _
Title:="Data field from Cell", _
Prompt:="Select a cell to pull in your Data Field", _
Type:=8)
On Error GoTo 0
'Test to ensure User Did not cancel
If rng Is Nothing Then Exit Sub
'Set Variable to first cell in user's input
Set rng = rng.Cells(1, 1)
'Data Field
gInput = rng.Value
'
End Sub