Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Vonner
 
Posts: n/a
Default Sorting Protected Worksheet


Is there a way to create a macro that sorts a protected worksheet where
some of the cells are locked without putting the protection password in
the macro?

I've created a workbook that is used for keeping track of baseball
stats. On one of the worksheets (that is protected) I have an area
where the user can enter the stats for there players but the player
name and a few other columns are locked (un-editable). I'm trying to
create a macro to sort the stats based on the batting average, but in
order to keep everything lined up correctly I need to sort the unlocked
cells along with four columns of locked cells. I can't figure out if
that possible.

Like I said, I got it to work by adding code to unprotect the sheet
before sorting, then protecting it again after the sort, but I had to
put the protection password in the code to do it. That defeats the
purpose of password protecting the sheet in the first place because any
can get the password by browsing the code.

Anyone have any ideas?

Thanks.


--
Vonner
------------------------------------------------------------------------
Vonner's Profile: http://www.excelforum.com/member.php...o&userid=25283
View this thread: http://www.excelforum.com/showthread...hreadid=387735

  #2   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Vonner,

That defeats the
purpose of password protecting the sheet in the first place because any
can get the password by browsing the code.


Try locking and protecting the project:

Right- click the project in the VBE , select VBA Project Properties,
Protection Tab...

This will hide your code from casual users. Excel does not, however, provide
a secure environment and a determined user will readily be able to gain
access to your code. Such determination need not exceed suitable Google
search.

---
Regards,
Norman



"Vonner" wrote in
message ...

Is there a way to create a macro that sorts a protected worksheet where
some of the cells are locked without putting the protection password in
the macro?

I've created a workbook that is used for keeping track of baseball
stats. On one of the worksheets (that is protected) I have an area
where the user can enter the stats for there players but the player
name and a few other columns are locked (un-editable). I'm trying to
create a macro to sort the stats based on the batting average, but in
order to keep everything lined up correctly I need to sort the unlocked
cells along with four columns of locked cells. I can't figure out if
that possible.

Like I said, I got it to work by adding code to unprotect the sheet
before sorting, then protecting it again after the sort, but I had to
put the protection password in the code to do it. That defeats the
purpose of password protecting the sheet in the first place because any
can get the password by browsing the code.

Anyone have any ideas?

Thanks.


--
Vonner
------------------------------------------------------------------------
Vonner's Profile:
http://www.excelforum.com/member.php...o&userid=25283
View this thread: http://www.excelforum.com/showthread...hreadid=387735



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
Sorting on a protected worksheet Sue Excel Discussion (Misc queries) 6 June 12th 05 09:26 AM
Insert comment in protected worksheet The Tuner Excel Worksheet Functions 2 June 6th 05 11:38 PM
Import/Export XML in protected worksheet jgentillet Excel Discussion (Misc queries) 0 May 13th 05 05:42 PM
Question about sorting in protected worksheet SJC Excel Worksheet Functions 6 March 24th 05 10:35 PM
Sorting protected worksheet Phyllis Excel Discussion (Misc queries) 3 December 15th 04 11:27 PM


All times are GMT +1. The time now is 01:01 PM.

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

About Us

"It's about Microsoft Excel"