+ Reply to Thread
Results 1 to 5 of 5

I need to move from cell to cell in a predefined order

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    Felixstowe, England
    MS-Off Ver
    2010
    Posts
    3

    I need to move from cell to cell in a predefined order

    I need to move from cell to cell in a predefined order when the tab or enter key is used.
    I have a form that has 40 cells dotted around it that need filling in in a specific order as test results are measured.
    I have locked the form so only the cells that need filling in can be changed and this works to a degree.
    The problem I have is some of the cells are merged, on the same row you could have a cell made up of two or more cells from the same row and a cell made up of two or more cells from two or more rows i.e.
    H5 – M5 is the 1st cell, R4 – V4 & R5 – V5 the 2nd, C8 – L8 & C9 – L9 the 3rd, M8 – V8 & M11 – V11 the 4th, B12 – L12 the 5th, B13 – L13 the 6th and so on.
    The problem I have is the form doesn’t treat the merged cells as one cell, using the tab or enter key will move to the next unlocked cell in the usual manor even if it is part of a merged cell.
    Can anyone help please.

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

    Re: I need to move from cell to cell in a predefined order

    Ok

    If you declare LastCell as a public variable then

    Please Login or Register  to view this content.
    will move the cursor from B1 downwards 2 rows at a time whatever you do.

    so now we need to modify it to move in sequence.

    Let me think on that.

    Ok I have listed my cells in MyArray each time I change my selection I am taken to the next cell listed in MyArray.

    These are sheet specific macros, Right click on the sheet name at the bottom of excel and select view code

    Paste the code in the visual basic window that opens and then close it.

    Don't forget to declare LastCell as a public variable in a normal Macro module.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 04-16-2015 at 06:13 PM.
    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
    04-16-2015
    Location
    Felixstowe, England
    MS-Off Ver
    2010
    Posts
    3

    Re: I need to move from cell to cell in a predefined order

    Hi mehmetcik

    Thank you for your help, I’ve tried several times to apply your suggestions to my form but I must be doing something wrong,as all I can get it to do is move to the next unlocked cell to the right and then it does nothing.
    you will have to forgive me I’m sure it’s something really silly but this is the first time I’ve tried to us any of Excels amazing features. In the past I’ve just made up the form and filled them in manually but with an ever increasing number to fill in I was trying to make life a bit easier.
    I have tried to attach a copy of my form in the hope you could find the time to have a look and see where I’ve gone wrong. The white cells are the ones I need to fill in in the order I have numbered them.
    Regards

    V8dfa

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

    Re: I need to move from cell to cell in a predefined order

    I modified the macro and it moved in order from H5 to V19 using the tab or enter keys with no problems.

    I then modified the macros to make then a bit more robust.

    You need to modify the line:-

    Please Login or Register  to view this content.
    To include the rest of your cells.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-16-2015
    Location
    Felixstowe, England
    MS-Off Ver
    2010
    Posts
    3

    Re: I need to move from cell to cell in a predefined order

    Hi mehmetcik

    that works great Thank you so much for all your help.

    Regards

+ 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. Replies: 1
    Last Post: 10-14-2014, 03:46 AM
  2. [SOLVED] Move tab to new workbook without predefined name
    By Craig K. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-06-2014, 12:30 PM
  3. Insert Image to adjacent cell, not predefined cell
    By tshrader in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-05-2013, 10:50 AM
  4. Formatting data input in order to use predefined macro
    By padrald0w in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 06:00 AM
  5. Sort data to match a predefined list order
    By Neil0782 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-12-2012, 08:53 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