Complicated code

magnum0357

New Member
Joined
Feb 8, 2009
Messages
29
OS = xp home
Excel 2000

I have the following code :

Private Sub CommandButton2_Click()
Dim Response As String
Response = InputBox("Please enter a Password", "Password Required")
Select Case Response
Case Sheet2.Cells(3, 7)
Application.Goto Reference:=['Sheet22'!A1]
Case Is <> Sheet2.Cells(3, 7)
MsgBox "You need a password to access this information", _
vbCritical + vbOKOnly, "Access Denied"
Sheet2.Range("A1").Select
End Select
End Sub

When sheet22 is activated it is supposed to run this code :

Private Sub Worksheet_Activate()
Application.ScreenUpdating = False
Dim rgn1 As Range
Dim cell As Range
Set rng1 = Range("F8:F1173")
For Each cell In rng1
If cell.Value <> "a" Then
cell.EntireRow.Hidden = True
Else
cell.EntireRow.Hidden = False
End If
Next
Application.ScreenUpdating = True
End Sub

It worked before I placed the password code, but now it doesn't, it takes me to the correct sheet and doesn't give anytype of error, it's kinda like the code is turned off......???

Can anyone help
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,812
Messages
6,121,693
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top