Stop Screen Flickering When Using Hide Rows Macro

andybason

Board Regular
Joined
Jan 7, 2012
Messages
217
Office Version
  1. 2016
Hello

I am using this macro via an activex checkbox. It works ok but the screen flickers whenever it is selected or deselected. By hiding a row I would have expected the rows below to move up but the issue here is that they seem to jump up but then jump back to the starting point.

VBA Code:
Private Sub CheckBox2_Click()

If CheckBox2 = False Then
[11:11].EntireRow.Hidden = True
Else:
[11:11].EntireRow.Hidden = False


End If
End Sub

I have tried using Application.ScreenUpdating but this doesn't make any difference.

Is there a way to stop this happening?

Thank you
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
That is just showing/hiding a single row & I don't get any screen flicker so I'm not sure what you have in your sheet/workbook that might cause annoyance flicker.

BTW, your code could also be written like this (with screenupdating off/on added before/after if you want)

VBA Code:
Private Sub CheckBox2_Click()
  Rows(11).Hidden = Not Rows(11).Hidden
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

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