I have a file with 2 sheet: Sheet1, Sheet2
Now i want a code do jod for if sheet2 select (active) then it show input password to edit data else sheet1 select (active).
Please show me a code do it...?
I have a file with 2 sheet: Sheet1, Sheet2
Now i want a code do jod for if sheet2 select (active) then it show input password to edit data else sheet1 select (active).
Please show me a code do it...?
Put this in the code module for sheet2
![]()
Private Sub Worksheet_Activate() Application.EnableEvents = False ThisWorkbook.Sheets("Sheet1").Activate If LCase(CStr(Application.InputBox("Type, friend, and enter", Type:=2))) = "friend" Then ThisWorkbook.Sheets("Sheet2").Activate End If Application.EnableEvents = True End Sub
Thx for code.
It work great.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks