Stopped the flicker then added a protect/unprotect to the macro and flicker started up again??

RobbieNZ

New Member
Joined
Aug 17, 2010
Messages
21
Hi there, I have the code below that hides rows if the test cell is 0 or blank.

The screen on sheet 1, which drives the results for this "Q U O T E" Sheet, was flickering badly when every drop down box or tick box was selected. I Fixed that with "Application.ScreenUpdating = False"
However, I now want to protect the sheets and tried to add the below:

Sheet8.Unprotect Password:="Secret"
my code
Sheet8.Protect Password:="Secret"

This created really bad flicker again and then I started getting a 1004 runtime error on
Rows("1:" & Worksheets("Q U O T E").UsedRange.Rows.Count).EntireRow.Hidden = False

So I have deleted the protect/unprotect code for now. Would really like to get this to work without the flicker?
Any suggestions greatly appreciated

BTW - I have picked up all of my code from the internet, am a total novice so need layman explanations :eek:)

Thanks in advance

Code:
Private Sub Worksheet_Calculate()
Dim myresult As String
Dim MyResult1 As String
Dim MyResult2 As String
Application.ScreenUpdating = False
Application.EnableEvents = False
 
Rows("1:" & Worksheets("Q U O T E").UsedRange.Rows.Count).EntireRow.Hidden = False
myresult = Worksheets("Q U O T E").Cells(99, 1).Value 'Controls'
MyResult1 = Worksheets("Q U O T E").Cells(64, 1).Value 'Valve Chamber'

''''''''''''''''''''''''''''''''''''''''''''''''''
Select Case MyResult1
Case "", "None", "0"
Rows("64:83").EntireRow.Hidden = True
Rows("156:156").EntireRow.Hidden = True
End Select
Select Case myresult
Case "", "None", "0"
Rows("99:114").EntireRow.Hidden = True
End Select
Application.EnableEvents = True
Application.ScreenUpdating = True

End Sub
 

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,795
Messages
6,121,624
Members
449,041
Latest member
Postman24

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