JumboCactuar
Well-known Member
- Joined
- Nov 16, 2016
- Messages
- 788
- Office Version
- 365
- Platform
- Windows
Hi,
having trouble figuring this out, i have the following sheet code:
and i want to pass the myvar1 to a macro but unsure how
so i can then use myvar1 like this example
Appreciate any help
having trouble figuring this out, i have the following sheet code:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("Z2:Z50")) Is Nothing Then
If Target.Offset(0, 1).Value = Target.Offset(0, 2).Value Then
'do nothing
Else
myvar1 = target.value
call Macro2
End If
End If
End Sub
and i want to pass the myvar1 to a macro but unsure how
so i can then use myvar1 like this example
Code:
Sub Macro2()
If myvar1 > 50 then
msgbox (myvar1 & "Greater than 50")
End If
End Sub
Appreciate any help
Last edited: