Your technology certification is waiting. Enroll in Cloud Class ®
'protection of the sheet is required otherwise the password will still be visible in the formula bar
'check if protection is in place already and unprotect is required
Cells.Locked = False
Dim col As Integer, HeaderRow As Integer
HeaderRow = 1 ' the row the column headers are in
For col = 1 To Cells(HeaderRow, Columns.Count).End(xlToLeft).Column
If InStr(1, Cells(HeaderRow, col), "pwd", vbTextCompare) Or InStr(1, Cells(HeaderRow, col), "password", vbTextCompare) Then
With Range(Cells(HeaderRow + 1, col), Cells(Rows.Count, col).End(xlUp))
.NumberFormat = ";;;**"
.FormulaHidden = True
.Locked = True
'protect the sheet again
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.