I have a sheet ("SheetName") which contains a warning pop-up when it is selected manually, using the code below:
Private sub Worksheet_Activate()
If Msgbox("warning text",vbOkOnly)=7 then
end if
End Sub
which works fine when the sheet is selected.
However, I also have another macro which updates the data in this sheet from a masterfile, and when the code below is run:
Sheets.("SheetName").Select
this also triggers the warning. Is there any way to differentiate if the worksheet selection is manual by the user or triggered by another line of VBA code?
Thanks
Robert
Private sub Worksheet_Activate()
If Msgbox("warning text",vbOkOnly)=7 then
end if
End Sub
which works fine when the sheet is selected.
However, I also have another macro which updates the data in this sheet from a masterfile, and when the code below is run:
Sheets.("SheetName").Select
this also triggers the warning. Is there any way to differentiate if the worksheet selection is manual by the user or triggered by another line of VBA code?
Thanks
Robert