View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default Worksheet change event for data validation??

Why not just Worksheet_Selection event to stop them visiting columns


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE = "B:B,H:H,M:M"

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Range("A1").Select
End If

End Sub

This is worksheet event code, which means that it needs to be
placed in the appropriate worksheet code module, not a standard
code module. To do this, right-click on the sheet tab, select
the View Code option from the menu, and paste the code in.
--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Meltad" wrote in message
...
I've got a worksheet with about 70 columns and have created 6 different
custom views. I now need to protect certain columns (ideally this would be
different columns for each view) but the views dont work once I've

protected
the sheet. Is there a way around this?

Can I apply data validation to the cells/columns to prevent any changes
being made to certain coloumns? How could I use worksheet change event to

set
data validation? Any code greatly appreciated!

Thanks