View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Detecting active customview

I don't think there is an easy way to detect the active custom view.

What I've suggested in the past (untested) is to hide certain rows or
columns.
Look for the hidden row to detect whether a custom view has been applied or
not.
Pretty lame way to get the active custom view, but I can suggest nothing
else.

PS.
Watch out with Custom Views filters and frozen panes:
To see what I mean:

My Column Header
a
b
c
d

freeze panes on "My Column Header" 1:1
filter on values = b
save as custom view
unfilter
apply that custom view
unfilter

now 1:2 are frozen - that's annoying.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bart" wrote in message
...
Hello

I have to create a piece of code wich makes a few buttons visible or in
visible depending of te active customview that is selected on a sheet.It
has
to be something like this:

Private Sub Worksheet_Activate()
If (ACTIVECUSTOMVIEW = view1) then
CommandButton1.Visible = False
End If

If (ACTIVECUSTOMVIEW = view2) then
CommandButton1.Visible = True
End If
End Sub


Thanks in advance...