I was working with a similar problem the other day. I have a sheet
hidden, that I only want unhidden with a password. I can tell you what
I did, but I don't quite know the code to hide a column, so I can't
translate the code for you.
Made a UserForm, with 2 textbox and 2 buttons. OK, and Cancel.
The password and form name gets put in the text boxes, and the code for
the entire form is.
Dim formunhidename As String
Dim newpasswordvalue As String
Private Sub CommandButton1_Click() 'ok button
formunhidename = TextBox2.Text
newpasswordvalue = TextBox1.Text
If (ActiveWorkbook.ProtectStructure = True) Then
ActiveWorkbook.Unprotect (newpasswordvalue)
Sheets(formunhidename).Visible = True
If (ActiveWorkbook.ProtectStructure = False) Then
ActiveWorkbook.Protect (newpasswordvalue)
End
End Sub
Private Sub CommandButton2_Click() ' cancel button
End
End Sub
What that did, was unprotect the workbook, using the passowrd entered.
Then, it takes the form name I entered and changes it to visible. Then
reprotects the worksheet.
So, One way you could do yours, is to take the column letter, and put
that in a box, and check it against a password in the other box.
If (newpasswordvalue="mypassword") then call unhide()
where Unhide() is however you show your column.
Hope that helps. Most of my solutions use the very limited knowledge
that I have, so they're hardly elegant. Learning as I reteach myself.
-Bob