+ Reply to Thread
Results 1 to 8 of 8

Entering text in a locked cell

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Entering text in a locked cell

    I have worksheet that contain values in column E and G and the total in column K. E and G are unlocked for manual input and column K contains the formula for the total and is locked. From time to time a certain row will not be applicable and before I started locking the cells in column K i would just put "not applicable". Now that it's lock I can't do that. My only option now is to put O in column E and G but I would rather put "not applicable" in column K. Is there a way around this. I was thinking of something along the line of a macro that would unlock the worksheet input the text and re lock it. The macro would have to lunch when a locked cell is selected or have a button that would launch the macro an would prompt for which cell the text would be entered. Is this possible.

  2. #2
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Entering text in a locked cell

    Hi there,
    look at attached file.
    This code does the mirracle
    Please Login or Register  to view this content.
    Run it with shortcut key Ctrl+q.
    Lock.xlsm

    Hope it helps
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  3. #3
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Entering text in a locked cell

    This is very cool. One small thing. I put this in my workbook and no matter what sheet I'm on it inputs it in the first sheet. How do I modify the code so that it would unlock, insert and lock the sheet I'm on or I can make a macro for each sheet and have a button to launch the macro. If I do it this way what do I put instead of Sheets (1). I tried Sheets (Name of my sheet) but that didn't work.

  4. #4
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Entering text in a locked cell

    Hi there,
    no need to write macro for each sheet. Here is one option how to do it.
    Run the macro with Ctrl+q and You will be able to apply 'Not Applicable' on active sheet.
    Please Login or Register  to view this content.
    Lock.xlsm

    Just adjust the range E1:E17 according to Your needs.

    Is this what You are looking for?

  5. #5
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Entering text in a locked cell

    That's exactly what I was looking for however for some reason I couldn't get it to work in my workbook. Probably because not every cell in column E and G are unlocked and not every cell in column K are locked. I tried erasing the column reference in the code and that seems to work. I also added my password because the worksheets are password protected. It seems to work beautifully across all worksheets. However there are 6 of the worksheet that this would apply too and all have different areas that are locked so will have to do more testing next week to make 100% sure it works everywhere but as of now it appears to work everywhere. This is how the code looks like now.

    Thanks so much for this. Everyday I learn something new on excel and it never ceases to amaze me. This has already given my ideas for future applications. +1 for you

    HTML Code: 

  6. #6
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Entering text in a locked cell

    Is there a way to change the code so that I would have to enter cell location and also enter the text to be displayed. Just ran across a scenario that I wanted to enter text other than not applicable.

  7. #7
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Entering text in a locked cell

    Hi there,
    You can add inputbox just after the first one. F.e.:
    Please Login or Register  to view this content.
    and change this:
    Please Login or Register  to view this content.
    Do not forget to declare the variable:
    Please Login or Register  to view this content.
    Hope it helps

  8. #8
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Entering text in a locked cell

    That's perfect. Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change text based on a locked cell
    By nsmjc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-31-2014, 12:29 AM
  2. Entering text in next available cell with userform
    By molesy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-11-2013, 12:58 PM
  3. Entering text in one cell, affects the value of another
    By The1theycallp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-15-2013, 08:02 PM
  4. Replies: 2
    Last Post: 03-07-2012, 09:42 AM
  5. Paste text into a locked or hidden cell
    By sparx in forum Excel General
    Replies: 2
    Last Post: 03-19-2006, 06:38 AM

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