Get Worksheet Bleed Only When Using Freeze Panes

tsgnms

New Member
Joined
Jun 29, 2016
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi all.

I'm having a real problem with a workbook which I use to maintain product and spare parts data as well as provide tools to extract and present it.

I have buttons that navigate to a specified sheet using VBA and hide all others to keep the backend stuff accessible only to me. Yes, it used the dreaded .select!

For some reason, though, I sometimes get significant "bleeding" where every time I move to a cell a different, hidden sheet flashes up for a second over half the sheet. It's extremely irritating and make the whole thing difficult to use. I've experimented with navigating to a dummy sheet that's blank first, but that hasn't stopped it.

If I unfreeze the panes, the bleeding stops, but as soon as I re-freeze them it starts happening again.

It also only seems to happen if I've navigated to certain sheets first before going to another, and then that sheet bleeds through.

Hope I've explained that okay, here's the navigation function I'm using at the moment for your reference:

VBA Code:
Function NavTo(Destination As String)

    Application.ScreenUpdating = False
    
    Set wb = ThisWorkbook
    
   
    wb.Sheets(Destination).Visible = True
    wb.Sheets(Destination).Select

    For Each sh In wb.Sheets
        If sh.Name <> Destination Then sh.Visible = xlVeryHidden
    Next sh
    
    wb.Sheets("DUMMY").Visible = True
    wb.Sheets("DUMMY").Select
    wb.Sheets("DUMMY").Visible = xlVeryHidden
    
    Application.ScreenUpdating = True
    
End Function

I've tried playing with the .ScreenUpdating, using and removing the dummy sheet and messing with the order, but so far nothing I do solves it.

Thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I don't know if this will change anything, but you need to change this line in the code:
wb.Sheets(Destination).Activate

Selecting a sheet could mean you are selecting multiple sheets. Activating a sheet makes it the only one you are working.

Do you have other macros running? Specifically sheet event macros?
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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