Custom Views...

Home Search Site Map

Up
Comments
Custom Views...
Formula Bar
Full Screen
Header & Footer...
Normal
Page Break Preview
Status Bar
Task Pane
Toolbars
Zoom...

New! Excel User Group Now Open @ www.excelusergroup.org, Check It Out!


Menu command Type What happens next?
Custom Views... ...

This option allows you to save a view of the worksheet with autofilter on or columns/rows hidden and any print setting retained, allowing you to quickly replicate several different 'reports' from the same data.  To add a new view, simply press the Add.. button to fire the dialog below.

Remember to save a 'Normal' view, unfiltered, unhidden, etc before you start to save other 'views' of the data.a.

You could for example have two views using the same filtered column, so you would have a 'sales over £100' view and a 'sales under £100' view, for example.

VBA Sub UseViews()
'Hide two columns
Columns("B:C").Hidden = True
'Add a view called Columns Hidden"
With ThisWorkbook
.CustomViews.Add ViewName:="Columns Hidden"
'Unhide the two columns
Columns("B:C").Hidden = False
'Add a view called normal
.CustomViews.Add ViewName:="Normal"
'Apply columns hidden view
.CustomViews("Columns Hidden").Show
MsgBox "You have now applied a Columns Hidden view", _ vbOKOnly
'Apply normal view
.CustomViews("Normal").Show
MsgBox "You have now applied a normal view", vbOKOnly
End With
End Sub

Top

 

Copyright Nick Hodge 2008. All Rights Reserved.