From: Jim on
I need to hide and unhide some columns using a macro and then prompt for a
password when unhiding. I used the protect worksheet function and set a
password, and this worked fine. My user has now informed me that the protect
worksheet will already be in use.....

so now I just need to have a macro that hides some columns, but the unhide
is prompted by a password. Is this possible without using the protect
worksheet function?

From: Master Blaster on
Jim,

Your question is not completely clear; but maybe the code below will
help you:

yourPW= InputBox("password")

ActiveSheet.Unprotect Password:=yourPW

Columns("D:D").Select
Selection.EntireColumn.Hidden = True

Columns("D:D").Select
Selection.EntireColumn.Hidden = True

hope this helps.






On Mar 9, 10:31 am, "Jim" <zj...(a)live.co.uk> wrote:
> I need to hide and unhide some columns using a macro and then prompt for a
> password when unhiding. I used the protect worksheet function and set a
> password, and this worked fine. My user has now informed me that the protect
> worksheet will already be in use.....
>
> so now I just need to have a macro that hides some columns, but the unhide
> is prompted by a password. Is this possible without using the protect
> worksheet function?