+ Reply to Thread
Results 1 to 8 of 8

Range select

  1. #1
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Smile Lock cells based on selection

    Hi All,
    I want a simple macro,which is to lock the range of cells which are selected.Thanks in advance for the help

    Thanks
    Arnab

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Remember that without protection locking does nothing.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Lock cells based on selection

    I used this code but its not working,my main objective is,if I run the macro on certain cells or range of cells they cannot be edited or overwrited.
    Thanks in advance

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    As I said, without protecting the sheet locking does nothing. So you need to protect the sheet first. Then, assuming no password:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Lock cells based on selection

    Hi,
    So Can you kindl help me in this,can you provide me the full code of how to protect the sheet,then lock the cells.

    And to be more precise my objective is,there will be 2 icons.
    Once the cells are selected and the icon is clicked the cells will be locked
    and again if the other icon is clicked the range will be unlocked

  6. #6
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Smile Range select

    Hi,
    How to select any range of cells and them protect the cells using macro.

    Thanks

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    arnab0711, this is a duplicate of your earlier post.

    I'm going to merge the threads. Duplicate posting doesn't get different or better answers, but it does violate the forum rules.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  8. #8
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi,

    Try recording your actions using the "macro recorder" under Tools - Macro - Record New Macro...

    Once you have this code, you can ask for help in generalising the code to be more flexible (if needed).

    If you are new to macros I suggest having a look at Dave McRitchie's page:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm


    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ 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