View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Hide colum using VBA password

At is simplest, you could use something like the following to hide/unhide
column "E".

Sub HideUnhideWithPassword()
Dim PW As String
PW = InputBox("Enter a password:")
If StrComp(PW, "CorrectPassword", vbBinaryCompare) = 0 Then
With ThisWorkbook.Worksheets("Sheet1").Columns("E")
.Hidden = Not .Hidden
End With
Else
MsgBox "Invalid Password"
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"shapiro" wrote in message
...
Does anyone know a VBA code to hide a coumn using a password?