dirtywizard
New Member
- Joined
- May 1, 2015
- Messages
- 32
Hi all
I've set up a series of button click macros to guide users around an excel file I've built. These are linked to a series of 'storyboard' comments on the data they're looking at.
The current process takes users from sheet to sheet, hiding the commentary on the sheet moved from at the point the user moves to the next sheet (so that users can either choose to ignore the storyboard from the off, or go back without it in their way later on)
To fully close the loop I wanted to fire off a workbook_open macro to ensure all commentary is not visible when opening the workbook. I've written this:
which isn't hiding the shapes as required - it does hide shapes on the contents sheet in a couple of tests run, but doesn't move through the sheets hiding as required.
Any ideas what I next to do to fix it?
I've set up a series of button click macros to guide users around an excel file I've built. These are linked to a series of 'storyboard' comments on the data they're looking at.
The current process takes users from sheet to sheet, hiding the commentary on the sheet moved from at the point the user moves to the next sheet (so that users can either choose to ignore the storyboard from the off, or go back without it in their way later on)
To fully close the loop I wanted to fire off a workbook_open macro to ensure all commentary is not visible when opening the workbook. I've written this:
Code:
[COLOR=#212121][FONT=Arial]Private Sub workbook_open()[/FONT][/COLOR][COLOR=#212121][FONT=Calibri][FONT=Arial]Application.ScreenUpdating = False[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]On Error Resume Next[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]Dim sp As Shape[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]Dim ws As Worksheet[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]For Each ws In ThisWorkbook.Sheets[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]For Each sp In ws.Shapes[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]If sp.Name Like "story*" Then[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]ActiveSheet.Shapes(sp.Name).Visible = False[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]End If[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]Next sp[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]Next ws[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]Worksheets("Contents").Activate[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Calibri][FONT=Arial]Application.ScreenUpdating = True[/FONT][/FONT][/COLOR]
[COLOR=#212121][FONT=Arial]End Sub[/FONT][/COLOR]
which isn't hiding the shapes as required - it does hide shapes on the contents sheet in a couple of tests run, but doesn't move through the sheets hiding as required.
Any ideas what I next to do to fix it?