Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-2007, 09:41 PM
Brian
 
Posts: n/a
VBA and Protect Worksheet Dilemma

Hi,

I am a novice at VBA and have struck a little problem. I have made a table
in Excel that compares various Insurance Companies covers. I have checkboxes
for the user to select which companies he/she wishes to compare and then a
Compare button which takes the user to the worksheet with the comparisons on
it showing only the chosen insurers.

Here is my problem: I cannot protect the worksheets without getting a
VBAerror. VBA cannot show columns that are hidden, or hide columns that are
shown if the worksheet is protected. Can anyone assist me in how to overcome
this issue, please? It is imperative that the worksheets are locked to
prevent anything being changed by the user, intentionally or otherwise.

Best regards,
Brian.


Reply With Quote
  #2 (permalink)  
Old 11-28-2007, 09:57 PM
hall.jeff@gmail.com
 
Posts: n/a
Re: VBA and Protect Worksheet Dilemma

You need to unprotect the worksheet and then protect it back

If you need to unprotect the whole workbook then its

ThisWorkbook.unprotect Password

If it's just the sheet then

ThisWorkbook.Worksheets("Sheet1").Unprotect Password

For ease of use, I would recommend setting up a global constant that
contains the password

Then, to protect it, you'll need to password protect your VBA code:
Tools->VBA Project Properties
Reply With Quote
  #3 (permalink)  
Old 11-28-2007, 10:21 PM
Brian
 
Posts: n/a
Re: VBA and Protect Worksheet Dilemma

Hi Jeff,

thank you so much for not only responding to me as quickly as you did, but
for telling me exactly what I needed to know! You have no idea how much I
appreciate it.

Best regards,
Brian.

<hall.jeff@gmail.com> wrote in message
news:123c9ec7-1627-4ee3-826c-e395b516b604@b15g2000hsa.googlegroups.com...
> You need to unprotect the worksheet and then protect it back
>
> If you need to unprotect the whole workbook then its
>
> ThisWorkbook.unprotect Password
>
> If it's just the sheet then
>
> ThisWorkbook.Worksheets("Sheet1").Unprotect Password
>
> For ease of use, I would recommend setting up a global constant that
> contains the password
>
> Then, to protect it, you'll need to password protect your VBA code:
> Tools->VBA Project Properties



Reply With Quote
  #4 (permalink)  
Old 01-21-2008, 09:51 PM
siekrun@gmail.com
 
Posts: n/a
Re: VBA and Protect Worksheet Dilemma

I have a workbook im working on. Within the work book, there will be
10 worksheets and with it 10 users. I am trying to password protect
each work sheet with specific passwords. I have the format locked, I
am trying to password protect the unlocked boxes only.

I am thinking there is nothing excel can do to help. But I am have
been working on this for 1 week now and have not figured it out. Can
anyone help?
Reply With Quote
  #5 (permalink)  
Old 01-21-2008, 11:00 PM
Gord Dibben
 
Posts: n/a
Re: VBA and Protect Worksheet Dilemma

Not enough detail to get a good idea of what you want.

One sheet per user but all sheets visible?

One sheet per user and all sheets but user's is hidden?

Each user knows only his password to unprotect?

What do you mean by "the format locked"?

Why would you want to protect the "unlocked boxes only"?

I would think you would want to protect the sheet but allow users to enter data
in the unlocked cells.

Check out this thread to see if you get some ideas then post back.

http://tinyurl.com/ysj6dw


Gord Dibben MS Excel MVP

On Mon, 21 Jan 2008 13:51:14 -0800 (PST), siekrun@gmail.com wrote:

>I have a workbook im working on. Within the work book, there will be
>10 worksheets and with it 10 users. I am trying to password protect
>each work sheet with specific passwords. I have the format locked, I
>am trying to password protect the unlocked boxes only.
>
>I am thinking there is nothing excel can do to help. But I am have
>been working on this for 1 week now and have not figured it out. Can
>anyone help?


Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



All times are GMT. The time now is 06:03 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Credit Cards | Credit Card Consolidation | Babb Fest | Manga | Credit Report



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114