Hi guys
Know you can help me on this.
I'm trying to run a VBA code when the worksheet is loaded but only want to run it once no matter what.
I'm having this code working but as the worksheet is locked/protected I want to a variable instaid of the cell value in A1.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim N As Long
If Worksheets("Diagram").Range("A1").Text = "Done" Then Exit Sub
'code runs here
Worksheets("Diagram").Range("A1") = "Done"
End if
Know you can help me on this.
I'm trying to run a VBA code when the worksheet is loaded but only want to run it once no matter what.
I'm having this code working but as the worksheet is locked/protected I want to a variable instaid of the cell value in A1.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim N As Long
If Worksheets("Diagram").Range("A1").Text = "Done" Then Exit Sub
'code runs here
Worksheets("Diagram").Range("A1") = "Done"
End if