+ Reply to Thread
Results 1 to 15 of 15

block only specific cells

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    block only specific cells

    Hi.
    I want to block only the cells "B1, C1, D1" if cell "A1" is different from "RECAP"
    Please Login or Register  to view this content.
    Last edited by marreco; 10-20-2012 at 05:33 PM.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: block only specific cells

    Do you mean to say the other cells are also getting blocked? By default, all the cells are locked. When you protect the worksheet, everything will become uneditable.

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: block only specific cells

    Hi.

    There is no way to block only just "B1, C1, D1"?

    Tthank you!!

  4. #4
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: block only specific cells

    Unlock all the cells in your worksheet. When this code runs, it will block only B1, C1, and D1.

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: block only specific cells

    Hi...

    I want to block only the cells "B1, C1, D1" if cell "A1" is different from "RECAP"

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: block only specific cells

    Hi

    Any idea?

    Thank you!!

  7. #7
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: block only specific cells

    Ya unlock all your cells.

    1. Unprotect your sheet
    2. Select all cells --> goto format cells
    3. Under protection tab --> uncheck "Locked"
    4. Protect your sheet again

    When your code runs, if cell A1 is not recap, it will lock only b1,c1 and d1. And you can edit the other cells.

  8. #8
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: block only specific cells

    hI.
    this is not what I need, should be done automatically.
    if "A1" = "RECAP" then only cells "B1, C1, D1" poderam be edited (the user will enter values ​​in these cells).

    if "A1" <> "RECAP" then only cells "B1, C1, D1" could not be edited (NOT the user will enter values ​​in these cells).

  9. #9
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: block only specific cells

    hI.
    this is not what I need, should be done automatically.
    if "A1" = "RECAP" then only cells "B1, C1, D1" poderam be edited (the user will enter values ​​in these cells).

    if "A1" <> "RECAP" then only cells "B1, C1, D1" could not be edited (NOT the user will enter values ​​in these cells).

  10. #10
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: block only specific cells

    Hi.

    Any idea?

    Thnak you!!!

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: block only specific cells

    Hello marecco,

    Try the attached WorkBook. No Protecting sheet, and Cells B1 to D1 are Blocked, if Cell A does not equal "Recap".
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  12. #12
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    916

    Re: block only specific cells

    If I understood correctly your request, try this:
    Please Login or Register  to view this content.
    Last edited by rollis13; 10-20-2012 at 04:39 PM.

  13. #13
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: block only specific cells

    hi rollis13

    I answered your code so perfect!

    thank you very much!!!

  14. #14
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    916

    Re: block only specific cells

    Glad being of some help
    There could be an issue with the ".UsedRange." if you need to use cells out of the previously used range.

  15. #15
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: block only specific cells

    Hello marecco,

    You are welcome.

    Thank you for the nice Rep.

+ 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