jUStPunkin
Board Regular
- Joined
- Mar 23, 2009
- Messages
- 67
I have a spreadsheet that I have protected (simply so that people don't change my formulas, either intentionally or accidentally). As I'm not as concerned with the intentional changes, I don't have it password protected, just protected.
In any case, on a particular worksheet, I give people a choice via a dropdown box. Based on their chose, I hide certain rows on the worksheet.
Back in access 2003, it worked fine. Now, in 2007, every single time someone changes any cell value on that worksheet, it takes forever. What I believe is happening is that it is running that hide/unhide code that I have written.
Can anyone offer some advice on how to speed this up - changes to the code, a better way to do what I want, etc.
Thanks in advance!
Thanks,
Brenda
In any case, on a particular worksheet, I give people a choice via a dropdown box. Based on their chose, I hide certain rows on the worksheet.
Back in access 2003, it worked fine. Now, in 2007, every single time someone changes any cell value on that worksheet, it takes forever. What I believe is happening is that it is running that hide/unhide code that I have written.
Can anyone offer some advice on how to speed this up - changes to the code, a better way to do what I want, etc.
Thanks in advance!
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("spouts").Unprotect
Select Case Worksheets("spouts").Range("$G$3")
Case Is = "Holes"
Worksheets("spouts").Range("$A$44:$N$67").EntireRow.Hidden = True
Worksheets("spouts").Range("$A$26:$N$42").EntireRow.Hidden = False
Case Is = "Slots"
Worksheets("spouts").Range("$A$27:$N$29").EntireRow.Hidden = True
Worksheets("spouts").Range("$A$34:$N$42").EntireRow.Hidden = True
Worksheets("spouts").Range("$A$47:$N$50").EntireRow.Hidden = True
Worksheets("spouts").Range("$A$44:$N$46").EntireRow.Hidden = False
Worksheets("spouts").Range("$A$51:$N$67").EntireRow.Hidden = False
Case Else
Worksheets("spouts").Range("$A$27:$N$67").EntireRow.Hidden = False
End Select
Worksheets("spouts").Protect
End Sub
Thanks,
Brenda