Running a Macro when Clicking a Cell
Hi,
My problem:
I have a list in sheet1. Now I want sheet2 to open when I click on a certain cell i call "cell2", and to open sheet3 when I click on "cell3" and so on...
Is this possible?
What I tried is:
under "this workbook":
Private Sub Workbook_Open(ByVal Target As Range)
If Target.Address = "cell2" Then
Worksheet("sheet2").Active
End If
End Sub
and under "sheet1":
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = false
On Error Goto ENEV
REM add your code below
If Target.Address = "cell2" Then
Worksheet("sheet2").Active
End If
ENEV:
Application.EnableEvents = true
End Sub
now when I do this, there comes: "error: argument not optional", but it doesnt say in which line and it doesnt work...
Does somebody know where i did it wrong?
Thank you, Alex