I am trying to figure out what I am doing wrong with global/public declarations. In the code I am writing, I have the following code in the “ThisWorkbook”
Public HemiRes As Double
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Data" Then
ActiveWorkbook.Sheets("Data").Range("A2").Value = HemiRes
End If
End Sub
Then in another sheet I have am using the command to transfer the value:
Private Sub CommandButton1_Click()
HemiRes = Worksheets("Hemi").HemiRad.Value
End Sub
The value of HemiRes is always 0, no matter what I seem to do. Is there something I an not correctly understanding about the way I can save values to a public declared variable from any sheet?
Thanks
Bookmarks