+ Reply to Thread
Results 1 to 7 of 7

VBA to move between unlocked cells in specific order

  1. #1
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    VBA to move between unlocked cells in specific order

    Hi

    I have a sheet where I want the user to be guided to the next cell in sequence on a protected sheet, to either type in an answer or make a selection from a drop down list, or leave blank as the case be, before moving on to the next specified cell.

    I'm currently using a worksheet change event to move to a particular cell if the current cell contains an entry, the problem is if a user leaves a cell blank and then moves on it goes back to the blank cell, as I also have Data Validation messages in each cell, as the macro runs and checks each cell for an entry you see the validation message pop for a split second which doesn't look good

    This is a section of my existing code

    Please Login or Register  to view this content.
    Is there an alternative simple code that would guide the user to cells in a specific order, and not go back looking for empty cells if the user left it blank for some reason which they may need to do? I could get round leaving the cell blank by asking the user to select N/A if appropriate so the curser goes on to the next cell, however the code still appears to go back and check each cell looking for an entry where you see the data validation message box flash very briefly

    So if I have a range of cells for example in order of G5,J5,O5,G7,J7,G8,G9 etc that I want the user to be guided to, how could I get the next cell in sequence to be selected if the user presses Enter after typing something in the cell, makes a selection from a drop down list within the cell, or leaves it blank and presses enter?

    Hope that isn't too confusing

    Many thanks in advance

    Twaddy

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to move between unlocked cells in specific order

    You need three macros to make this happen.

    One is in a standard module. Two are sheet Specific

    But is better with 4.

    Just added a third sheet specific macro

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 02-12-2015 at 08:53 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: VBA to move between unlocked cells in specific order

    Hi Mehmetcik

    Thanks very much for taking the time to look at this and post your solution which I have working ok, really appreciate it

    Something I've realised which is a small issue is that if a user wants to go back and change of one their answers once they've ran through the full set of sequential cells, say they want to change the 3rd cell in sequence, they can select the cell ok to change their answer however if they also want to then change the 7th cell in sequence they have to re-input their answers in the 4th, 5th and 6th cells to get to the 7th. Is there a way to stop the code once it been completed once and reached the last cell to allow the user to easily go back and change answers?

    Many thanks

    Twaddy

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to move between unlocked cells in specific order

    you could insert a line to check if your cells are complete then exit the sub

    However you can just select any cell
    Last edited by mehmetcik; 02-12-2015 at 10:15 PM.

  5. #5
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: VBA to move between unlocked cells in specific order

    Apologies however what would the code look like and where would I enter it

    When you say you can just select any cell, do you mean with the code as it stands on your original post? I've found that you have to make an entry in each cell in sequence otherwise it keeps going back to the blank cell. Although saying that I've noticed on a couple of issues tonight

    Some of the cells require a selection from a drop down list, if you type an invalid entry in the cell rather than using the drop down list you get the Validation error message with options to Retry Cancel or Help, if you press Retry you can't use the drop down arrow any longer, if you press cancel it deletes the incorrect entry and moves the cursor to the next cell and you can't go back. I've also found that if you double click in a cell the cursor appears in the next blank cell in sequence, where you can either make an entry or if you press enter it moves to the next cell

    Apologies for coming back with more issues, hopefully you can help

    Many thanks

    Twaddy

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to move between unlocked cells in specific order

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  7. #7
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: VBA to move between unlocked cells in specific order

    Sample.xlsm

    Hi

    Hopefully that's uploaded ok and gives you what you need, I've mocked up the path I need the cursor to take, filled the cells yellow and numberer the desired path starting at 7, you'll see the first 6 yellow cells at the start of the sheet which I haven't numbered as some will have validation lists which I've left in so you can see the issue if you try and enter something not on the list, ideally I'd like the top 6 cells to run across then down and across again before moving on to ref 7

    I'd added your code, which does work if you enter everything as you should, unfortunately I know there are lots of people at work who struggle with anything Excel based hence I'm trying to make it foolproof. The issues are the drop downs as I mentioned, another being if you double click into a cell it moves on and you can't go back, and then if you run through the full sequence to the end and then want to change some answers. Say you want to change ref 7, you can click on that cell fine, if you then want to also change say ref 15 you can't unless you enter answers 8 through to 15 again

    Thank you so much for your help with this

    Twaddy

+ 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] Move cells containing specific content into a specific column
    By mb5555 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2012, 01:46 AM
  2. Replies: 1
    Last Post: 03-07-2009, 03:42 AM
  3. Moving from unlocked cells to unlocked cells in an excel form
    By Stacey Lee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-24-2006, 03:50 PM
  4. Locked spreadsheet, move cursor only to unlocked cells?
    By dhilligoss in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2005, 10:29 AM
  5. [SOLVED] move between unlocked cells on protected sheet
    By ayanna in forum Excel General
    Replies: 1
    Last Post: 04-27-2005, 01:06 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