View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Macro (password)

Mike, Explain a little more about what you want to happen and when you want
it to happen.

Are you wanting to require someone to enter a password before they can
change the contents of a particular cell, such as C300? If that's the case,
you'd need to use either the individual Worksheet_SelectionChange() event
handler, or the Workbook_SheetSelectionChange() event handler. If you use
the Workbook_ event processes, then your code will be effective for all
sheets in the workbook unless you put code into it to restrict it to a few
specific sheets by name.

"Mike" wrote:

I have this macro now i would like to set this cell with a password is this
possible

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
If Intersect(Target, Range("C300")) Is Nothing Then Exit Sub
ActiveSheet.Tab.ColorIndex = 15
End Sub