+ Reply to Thread
Results 1 to 3 of 3

Preventing users from selecting a cell in a range

  1. #1
    Registered User
    Join Date
    07-11-2007
    Posts
    9

    Preventing users from selecting a cell in a range

    I'm pretty new to macros so bare with me.

    I have created a macro to ask the user to input a cell reference and then the macro inserts a row at that point and copies the formulae from the row below.

    I want to modify the macro to prevent the user from selecting any cell in rows 1 to 21.

    How do I do this?

    Thanks

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You will need to lock the Cells & protect the sheet. First make sure that all Cells on the sheet are Unlocked - Select the whole sheet then Format Cells, Protection & uncheck locked.

    Run this code, it will lock the rows 1 to 21 & protect the sheet with the password "secret"

    Please Login or Register  to view this content.
    NOTE: you will need to unprotect the sheet before running ny other code to act on the sheet
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-11-2007
    Posts
    9

    Thanks for the prompt reply

    Thanks for the prompt reply.

    I'm not sure that your proposed solution will work in my situation. I already have protection switched on and a large number of cells locked. When the macro runs it switches off the protection and then asks the user to select a cell.

    If I have misunderstood you please could you re-post your solution with comments so that I can understand what it is doing - I'm very new to this.

    Thanks

+ 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