Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Programming with Sorting
Hi Everyone,
I'm not sure what is the different Macro and VBA, but I know that once Macro is recorded, you can do some modification/tweak to it, right? I recorded a Macro that will Unprotect a sheet and then sorting a section of the sheet, and then Protect the sheet back with the original password. First of all, I created this Macro, because Excel won't allow user to Sort anything after the sheet is locked. I guess it's my way to get around it. The purpose is to sort the sheet, obviously, without giving the password to the user, but when I try it out, the sheet still ask for the password. Is there a way to Hard Code the password in the Macro, so it won't ask for the password when I run it? Thank you for any suggestion. Neon |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Programming with Sorting
ActiveWorkbook.Unprotect Password:="XXXXXXXX" <<<your password
'Do Events ActiveWorkbook.Protect Password:="XXXXXXXX" <<<your password "Neon520" wrote: Hi Everyone, I'm not sure what is the different Macro and VBA, but I know that once Macro is recorded, you can do some modification/tweak to it, right? I recorded a Macro that will Unprotect a sheet and then sorting a section of the sheet, and then Protect the sheet back with the original password. First of all, I created this Macro, because Excel won't allow user to Sort anything after the sheet is locked. I guess it's my way to get around it. The purpose is to sort the sheet, obviously, without giving the password to the user, but when I try it out, the sheet still ask for the password. Is there a way to Hard Code the password in the Macro, so it won't ask for the password when I run it? Thank you for any suggestion. Neon |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Programming with Sorting
Thank you so much, JLGWhiz. This works out really great.
"JLGWhiz" wrote: ActiveWorkbook.Unprotect Password:="XXXXXXXX" <<<your password 'Do Events ActiveWorkbook.Protect Password:="XXXXXXXX" <<<your password "Neon520" wrote: Hi Everyone, I'm not sure what is the different Macro and VBA, but I know that once Macro is recorded, you can do some modification/tweak to it, right? I recorded a Macro that will Unprotect a sheet and then sorting a section of the sheet, and then Protect the sheet back with the original password. First of all, I created this Macro, because Excel won't allow user to Sort anything after the sheet is locked. I guess it's my way to get around it. The purpose is to sort the sheet, obviously, without giving the password to the user, but when I try it out, the sheet still ask for the password. Is there a way to Hard Code the password in the Macro, so it won't ask for the password when I run it? Thank you for any suggestion. Neon |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel programming - Conditional sorting | Excel Programming | |||
Programming my macro | Excel Programming | |||
Programming a new macro | Excel Programming | |||
Macro programming | Excel Programming | |||
Macro Programming | Excel Programming |