View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Smitty Smitty is offline
external usenet poster
 
Posts: 43
Default Using Custom Views in a protected worksheet

Here's one idea: if you have a Data Validation list that contains your Custom
View names and unprotect the cell it's in, you can use a change event. In
this case the list cell is F1:

Private Sub Worksheet_Change(ByVal Target As Range)
' Code goes in the Worksheet specific module
Dim rng As Range
' Set Target Range
Set rng = Range("J1")
' Only look at single cell changes
If Target.Count 1 Then Exit Sub
' Only look at that range
If Intersect(Target, rng) Is Nothing Then Exit Sub
' Action if Condition(s) are met
ActiveWorkbook.CustomViews(Target.Value).Show
End Sub

HTH,

Smitty

"Pierre" wrote:

I want to use custom views for entering data and then printing it...

Not being the one doing the actual entering of the data, I don't want people
to inadvertantly delete colums or other info, so I need to protect the
worksheet.

My different views consist of some colums being hidden for data entry, and
then revealed for printing... but I haven't been able to make this work with
the worksheet being protected... no matter what options I check or uncheck
while protecting the sheet.

Any ideas..?

Thanks!
Pierre, Montreal