Fordraiders
asked on
trying to get value from cell -1 from target.column
excel 2010 vba
I have an event:
xlApp_SheetSelectionChange (ByVal Sh As Object, ByVal Target As Range)
where my "Target"
is being passed into the procedure.
What I need:
I determine the value of the Target.Column value ....by passing a variable
mRangeColumn (this is the Column Number example "6")
Once I determine what value " Target.Value" is...
I want to get the value to the left of Target.Value
I have an event:
xlApp_SheetSelectionChange
where my "Target"
is being passed into the procedure.
What I need:
I determine the value of the Target.Column value ....by passing a variable
mRangeColumn (this is the Column Number example "6")
Once I determine what value " Target.Value" is...
I want to get the value to the left of Target.Value
Dim strNameBox As Range
Dim strColumnBox As Integer
On Error Resume Next
If Target.Column = "" Then
If Target.Column = mRangeColumn Then
strColumnBox = Target.Column - 1
strNameBox.Column = strColumnBox <------ error here
"wrong number of arguments or invalid property assignment"
UserForm2.TextBox1.Value = Target.Value
UserForm2.ComboBox1.Value = strNameBox.Value
Else
' code
End If
Else
' code
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, Got me on the right track anyway.
ASKER
Dim strNameBox As String
strNameBox = Target.Offset(0, -1)
This will do it...