When I refresh with the code in place , the numbers do refresh as they
should , but nothing is showing in B16.
ShareSheet is protected so changes to B16 cannot be made.
Because I error-trapped the code, you don't see an error message informing you
of that fact.
Also, the data refresh is actually done on LookUpData sheet and ShareSheet D4 is
only a reference to D4 on that sheet,
We could change the event type to Calculate but that would also update B16 when
VirtualLookUpData is refreshed..............not desirable, I would say.
Delete the code you have in ShareSheet
The following amended code goes into module of LookUpData sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo stoppit
Application.EnableEvents = False
If Me.Range("D4").Value <> "" Then
With Sheets("ShareSheet")
.Unprotect Password:="justme"
.Range("B16").Value = Format(Now, "dd-mm-yy hh:mm:ss")
stoppit:
Application.EnableEvents = True
.Protect Password:="justme"
End With
End If
End Sub
The code unprotects ShareSheet so the date/time can be added to B16
I used a cracker to unprotect ShareSheet for testing the code..
Works fine for me when I refresh data on LookUpData sheet.
Edit password "justme" to your actual password.
Gord