DipPatel
11-17-2016, 10:48 PM
Hello VBA Coders,
I'm in desire need of help with my code that I am writing.
I have this code, provided below.
The movements are set for each scenario.
For yyy I will be moving 1 row up and 2 columns left to gain the value. or 2 rows up and 2 columns left.(From current active cell.)
For zzz I wil be moving either one row up or two rows up. (From Current Active Cell.)
I just want to use the values of yyy and zzz in my input box prompt.
I have been using different methods (r1c1, offset, and xlup, etc) and have been failing. Any help or sense of direction would be helpful as I have been struggling for hours.
Sub test()
Set lol = ActiveCell
Dim yyy As Range
Dim zzz As Range
If lol.Offset(1, 0).Value = "" Then
yyy = lol.Offset(-1, -2).Value
zzz = lol.Offset(-1, 0).Value
Else
yyy = lol.Offset(-2, -2).Value
zzz = lol.Offset(-2, 0).Value
End If
MsgBox "zzz & yyy"
End Sub
I'm in desire need of help with my code that I am writing.
I have this code, provided below.
The movements are set for each scenario.
For yyy I will be moving 1 row up and 2 columns left to gain the value. or 2 rows up and 2 columns left.(From current active cell.)
For zzz I wil be moving either one row up or two rows up. (From Current Active Cell.)
I just want to use the values of yyy and zzz in my input box prompt.
I have been using different methods (r1c1, offset, and xlup, etc) and have been failing. Any help or sense of direction would be helpful as I have been struggling for hours.
Sub test()
Set lol = ActiveCell
Dim yyy As Range
Dim zzz As Range
If lol.Offset(1, 0).Value = "" Then
yyy = lol.Offset(-1, -2).Value
zzz = lol.Offset(-1, 0).Value
Else
yyy = lol.Offset(-2, -2).Value
zzz = lol.Offset(-2, 0).Value
End If
MsgBox "zzz & yyy"
End Sub