+ Reply to Thread
Results 1 to 7 of 7

Restrict Input to Next Empty Cell

  1. #1
    Registered User
    Join Date
    04-17-2004
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    21

    Restrict Input to Next Empty Cell

    I would like to restrict the user of a worksheet to only enter data in the next empty cell of the "C" column only (the initial entry will be in C5 and then continue on to the end).
    I realize that I can lock cells but it seems to stop another macro from auto filling those cells. When data is entered into the "C" column (by my keyboard and RFID device), another macro generates data for column "E, G & I". I would like to ensure that the user cannot select or enter data into any other cell apart from the next empty cell in the "C" column.
    Is that possible and as the administrator of the worksheet, is there an easy way to override the restriction if need be?
    Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Restrict Input to Next Empty Cell

    You could use a Selection Change event handler to monitor column C. If a cell is selected and it has something in it, you would select the next available cell (with or without a message). Thinking about it, you might want to check the position if the cell is empty, in case they select a cell way down the sheet.

    You could have a hidden control/configuration sheet with a toggle value in it. The first thing the Selection Change event handler would/could do is check that toggle. As Administrator, you could set or unset that value, effectively overriding the code.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-23-2013
    Location
    Gurgaon
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Restrict Input to Next Empty Cell

    Hello.....

    This is Kumar...

    i'm working on excel but i want the following to do, any one can help me...

    Let us take an example

    I want to lock the cell "A2" if the Cell "A1" is empty
    if we fill data in cell "A1" Cell "A2" have to automatically unlock

    this my requirement...........
    is there is any solution for this.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Restrict Input to Next Empty Cell

    @chgkak:

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  5. #5
    Registered User
    Join Date
    04-17-2004
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    21

    Re: Restrict Input to Next Empty Cell

    Thanks for your suggestion but I have no idea how to implement that. Could you give me a few pointers?
    Am I correct that my macro will not generate data in a locked cell?
    Thank you.

  6. #6
    Registered User
    Join Date
    04-17-2004
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    21

    Re: Restrict Input to Next Empty Cell

    Any additional help would be much appreciated.
    Thanks

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Restrict Input to Next Empty Cell

    Nothing to work with. There's no point me creating a workbook as test environment so that I can develop and test a hypothetical solution. And there is alos little point in describing how to go about implementing a hypothetical solution.

    Am I correct that my macro will not generate data in a locked cell?
    Probably not. With VBA, you can do pretty much what you want. Unprotect the sheet, unlock/lock cells, write data, protect the sheet.

    Regards, TMS

+ 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] Restrict Cells depending on input in another cell
    By Dave350z in forum Excel General
    Replies: 2
    Last Post: 01-28-2013, 11:38 AM
  2. Restrict the order of cell input
    By AJMaso in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2012, 05:31 PM
  3. Data Validation,Restrict Cell Input.
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-28-2011, 12:56 AM
  4. how do I restrict cell input to dates only?
    By James E Slack in forum Excel General
    Replies: 2
    Last Post: 12-11-2005, 08:10 PM
  5. Restrict input into cell array
    By dlp1848 in forum Excel General
    Replies: 1
    Last Post: 09-26-2005, 04:05 PM

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