Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel programming - Conditional sorting Praveen Mishra Excel Programming 1 April 14th 08 07:49 AM
Programming my macro Please help in building a Vba in excel Excel Programming 0 March 7th 07 11:31 PM
Programming a new macro Trond Excel Programming 4 March 15th 06 09:50 AM
Macro programming Kristin Excel Programming 1 September 27th 04 06:27 PM
Macro Programming Jamie[_3_] Excel Programming 1 August 27th 03 08:20 PM


All times are GMT +1. The time now is 12:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"