Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JD JD is offline
external usenet poster
 
Posts: 3
Default Macro with protected cells.

I am using Office 2000 and have a table with about 20 columns & 64
rows. Data is inputted into 18 of the columns from time to time, the
other 2 columns being calculations based on the inputted data.

In order to prevent inputting from overriding the formulae, in error,
I want to protected the 2 calculated columns. However, I also want
to sort the table, by macro, using the calculated columns as the
sorting basis.

I can get a macro to work OK if there is no protection. Is there a
way to do what I want.

Thanks for any help.

JD


  #2   Report Post  
Posted to microsoft.public.excel.programming
JD JD is offline
external usenet poster
 
Posts: 3
Default Macro with protected cells.

Thanks, Paul. As I said to Tim, I can get it to work with a blank
password.
Regretfully, I don't understand your second solution. I don't see
that anywhere under Tools/Protection.

JD

"Paul B" wrote:

JD, you could have your macro unprotect the sheet do the sort and then
reprotect the sheet, or you could protect the sheet with userInterfaceOnly
like this
Worksheets("sheet1").Protect password:="test", userInterfaceOnly:=True



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Macro with protected cells.

JD, use a macro somethinglike this for a password

Sub test1()
ActiveSheet.Unprotect password:="123"
'you code here
ActiveSheet.Protect password:="123"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"JD" wrote in message
...
Thanks, Paul. As I said to Tim, I can get it to work with a blank
password.
Regretfully, I don't understand your second solution. I don't see
that anywhere under Tools/Protection.

JD

"Paul B" wrote:

JD, you could have your macro unprotect the sheet do the sort and then
reprotect the sheet, or you could protect the sheet with

userInterfaceOnly
like this
Worksheets("sheet1").Protect password:="test", userInterfaceOnly:=True





  #4   Report Post  
Posted to microsoft.public.excel.programming
JD JD is offline
external usenet poster
 
Posts: 3
Default Macro with protected cells.

Thanks again, Paul, I've got it working.
JD


"Paul B" wrote:

JD, use a macro somethinglike this for a password

Sub test1()
ActiveSheet.Unprotect password:="123"
'you code here
ActiveSheet.Protect password:="123"
End Sub



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
macro to unlock and lock cells in password protected sheet Chris Excel Discussion (Misc queries) 3 February 26th 10 09:06 PM
Macro to clear checkboxes and protected cells Guy[_2_] Excel Worksheet Functions 2 December 29th 08 08:54 PM
Edit text format in non-protected cells in protected worksheet Bonnie Excel Discussion (Misc queries) 2 April 19th 08 04:48 PM
paste locked cells and unlocked cells in protected sheet Angeline Excel Worksheet Functions 15 November 1st 06 11:51 PM
use macro button to run macro in protected sheet earl Excel Discussion (Misc queries) 3 February 26th 06 10:21 PM


All times are GMT +1. The time now is 05:34 AM.

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"