+ Reply to Thread
Results 1 to 9 of 9

Check box help please!

Hybrid View

Jae Check box help please! 08-08-2005, 02:29 PM
swatsp0p have the macro 'unprotect'... 08-08-2005, 02:43 PM
Jae Can you tell me how I would... 08-08-2005, 02:46 PM
swatsp0p ActiveSheet.UnProtect 'your... 08-08-2005, 03:34 PM
Jae Bruce, Thanks for all your... 08-08-2005, 04:19 PM
  1. #1
    Registered User
    Join Date
    08-08-2005
    Posts
    3

    Check box help please!

    I have form that I am working on that has approximately 120 check boxes (I used the forms check boxes). I read previous threads about creating a macro to clear out the checks, which I have done successfully, but I would like the macro to do one more thing ... After clearing out all of the checks, I would like it to place checks on a range of check boxes.

    I thought I could use the following script, but it doesn't work when the sheet is protected.

    Sub UnCheckBox()

    With Sheet1

    .CheckBoxes.Value = False

    Range("N55:N209").Select
    Selection.Replace What:="FALSE", Replacement:="TRUE", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False

    End With

    End Sub


    Can someone help please?

    Thanks!

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    have the macro 'unprotect' the sheet, run the code and 'reprotect' the sheet.

    good luck
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Registered User
    Join Date
    08-08-2005
    Posts
    3
    Can you tell me how I would do that in the script? I'm fairly new to using visual basic.

    Thanks in advance,

    Jae

  4. #4
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    ActiveSheet.UnProtect
    'your code here
    ActiveSheet.Protect

    HTH

    Bruce

  5. #5
    Registered User
    Join Date
    08-08-2005
    Posts
    3
    Bruce,

    Thanks for all your help. One more question, how do I incorporate a password to this script?

    Jae

  6. #6
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    We will assume you have used the password "Lock" to protect your sheet. Use this code:

    ActiveSheet.UnProtect Lock
    'your code here
    ActiveSheet.Protect Lock

    of course, adjust the password to meet your needs.

    Reminder: passwords on sheets only stop someone from inadvertantly changing data. Any one so inclined can break an Excel password in a matter of a few minutes!

    HTH

    Bruce

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1