run marco when clickin on tab excel code example Example: SRun macro when worklsheet is activated Private Sub Worksheet_Activate() End Sub