+ Reply to Thread
Results 1 to 5 of 5

VBA Automatically move cells after data from a drop down list is entered or changed

  1. #1
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    VBA Automatically move cells after data from a drop down list is entered or changed

    I have tried the below code on a sheet in an attempt to move to a different cell/column after entering data/changing data in a particular range of cells by using their dropdown list (via data validation).
    The range the drop-down lists are in is a named range DataFacilityInput. These are cells in a column of a table.
    After any of these are entered for the first time, or changed in the future, I want excel to automatically jump 5 cells to the right into the respective cell of another row I need to update data in.

    I can get this code to work only once for any of the DataFacilityInput cells, only if the row is newly added to the table, but then it will not work for any of the preexisting data.

    I am trying to get this to work for two columns. DataFacilityInput & DataInitiatedBy

    Any suggestions you may have will help. Thx
    Please Login or Register  to view this content.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: VBA Automatically move cells after data from a drop down list is entered or changed

    I've just mocked up a workbook to do what I think you're trying here, using your code as above, and all works fine for me.

    Perhaps there's an issue with your workbook that is preventing it. Could you attach a desensitized version of it so we can investigate?

    BSB
    Attached Files Attached Files
    Last edited by BadlySpelledBuoy; 12-28-2020 at 06:08 AM.

  3. #3
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: VBA Automatically move cells after data from a drop down list is entered or changed

    Thank you. Attached file without changes.
    I tried your file which obviously worked. I then copied it into my workbook where it continued to work properly. However, after copying the vba code from your sheet to my sheet, my sheet does not work. Not sure what is going on but I'll take a closer look at the coding etc on my sheet.

    Just looked at the Name Manager and discovered my range is not updating when rows are added to the table. Any idea how to ensure all added rows or filtering of the table is reflected dynamically in the named range?
    Attached Files Attached Files
    Last edited by Crawfy; 12-28-2020 at 04:57 PM.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: VBA Automatically move cells after data from a drop down list is entered or changed

    The two named ranges called upon by your change event do not cover the whole height of the table. One covers only rows 18:24 and the other 15:24.

    If you change cells within those ranges all works as planned, but outside of that then nothing happens because the range is outside of where the INTERSECT in the macro is looking.

    I've resized them in the attached and all appears to be working.

    BSB
    Attached Files Attached Files
    Last edited by BadlySpelledBuoy; 12-28-2020 at 05:08 PM.

  5. #5
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: VBA Automatically move cells after data from a drop down list is entered or changed

    Thank you for all your help.

+ 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. Automatically Sorting a List by Name as New Data is Entered
    By essxmark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2019, 06:28 PM
  2. Data validation: Drop down list changed source by itself
    By Kevalin O in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-14-2018, 01:29 PM
  3. [SOLVED] Move cursor to the right automatically after data is entered/selected from the drop downs
    By sloshpuppy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2017, 11:14 AM
  4. [SOLVED] Execute data label coloring code when drop down list changed
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2017, 03:52 PM
  5. [SOLVED] Lock specific cells once a value is entered with a drop down list
    By MissDB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2014, 08:41 AM
  6. Replies: 2
    Last Post: 11-29-2013, 04:21 PM
  7. Replies: 5
    Last Post: 03-26-2012, 11:50 PM

Tags for this Thread

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