In workbook module I have this code, where I declared Global variable "a"
In sheet1 module I have this code where I'm trying to use declared variable "a"
Code
Public Sub Worksheet_SelectionChange(ByVal Target As Range)
a = Target.Value
End Sub
Public Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("A2")) Is Nothing Then Me.Range("A3").Value = a
End Sub
but code in sheet1 module do not considers "a" as the variable declared in workbook module.
Please tell what I'm doing wrong and how to do right