Closed Thread
Results 1 to 10 of 10

After input, move all rows 1 down

  1. #1
    Registered User
    Join Date
    06-07-2018
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    5

    After input, move all rows 1 down

    Hello everyone,

    I am trying to help a friend create her Excel sheet. We are both sort of new to Excel but eager to learn.
    As far as I read on internet searches, the solution might involve a Macros of sorts? I am hoping it could be solved in a easier way.

    The situation:
    Every day new items arrive in the store. We input the day, the item type and the amount.
    The next day new items arrive. Over time this list will grow
    This list is only for keeping a record of what came in everyday


    Question:
    Is it possible, to have 3 cells on top of the sheet. This is where we input our data. Then, we press Enter, or a button of sorts. And the new data will be moved one row down, along with the rest of the data in the sheet. (we do not want to manually insert a row. We have co-workers that are computer illiterate and we want to make it as simple as we can for them.)

    So the data on row B6,C6 and D6 will move to B7. C7 and D7 (and etc, all the other data below it will also move one row down.).
    Will formulas in the cells also move down and adjust their values?



    I have attached an example file. (This is made in Openoffice-Calculator as I do not own a copy of Excel). My friend does own Excel. 2013 or 2016.


    Thank you for your time,
    Arjan
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,857

    Re: After input, move all rows 1 down

    In your worksheet, open the VBE (Alt + F11), In the left window, double click on the sheet you are working on. In the window that opens, paste the following VBA code. Everytime you enter data in cells B,C and D, after entering data in D, the macro will insert a new row.

    Please Login or Register  to view this content.
    I am not familiar with Open Office so I don't know if this will work in that environment. It will work with Excel.
    Attached Files Attached Files
    Last edited by alansidman; 06-08-2018 at 04:24 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: After input, move all rows 1 down

    Why not just add the data to the end of the list?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    06-07-2018
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    5

    Re: After input, move all rows 1 down

    FDibbins:
    The point is to make the list as simple as possible. I work with computer illiterates. Just inputting data at the top of the list should be the simplest way. (at the end of the year the list will be atleast 365 rows down. It will be to much effort for them to scroll down, use Ctrl + F etc etc.)


    AlanSidMan:
    Thank you very much. It does not seem to work on Calc / openoffice. I will try it when I see my colleague again (she has Excell). I will keep you posted.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: After input, move all rows 1 down

    Quote Originally Posted by Arjan35 View Post
    FDibbins:
    The point is to make the list as simple as possible. I work with computer illiterates. Just inputting data at the top of the list should be the simplest way. (at the end of the year the list will be atleast 365 rows down. It will be to much effort for them to scroll down, use Ctrl + F etc etc.)
    If the save the file where they last finished, it will be at the bottom anyway, they wont need to scroll anywhere. You could even set the sheet up so that when they hit enter, it auto moves to the right (if that is where they will be entering), and on the last entry of that row, it auto jumps to the next row, 1st entry cell

  6. #6
    Registered User
    Join Date
    06-07-2018
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    5

    Re: After input, move all rows 1 down

    Alansidman:
    the code works beautifully. Thank you very much.
    Right now I am trying to adjust it (and understand it ) and insert it into the Excel file I am using at work.

    Many thanks again.


    FDibbins:
    thank you for the tip. These little tweaks will save a lot of time as I encountered this issue in another Excel file I made.
    Last edited by Arjan35; 06-17-2018 at 12:56 PM.

  7. #7
    Registered User
    Join Date
    06-07-2018
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    5

    Re: After input, move all rows 1 down

    Two follow up questions / tweaks to the code:

    1a)
    If cell D has no inserted value. When pressing enter. Nothing happens.
    Only when I insert a number (like 0 for indicating nothing), the macros works. Is it possible to activate the macros without inserting any value in cell D but by only pressing Enter?

    1b)
    after pressing Enter. Reset the cursor to cell B (the start).


    2)
    The color background also moves when the macros is activated. Is it possible for the color background not to move? (I am using the color to indicate to my colleagues THIS is the area to input the new values.)


    Again, thank you very much for your time. This is very helpful to me.
    Last edited by Arjan35; 06-17-2018 at 01:26 PM.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,857

    Re: After input, move all rows 1 down

    This is a worksheet change event that occurs automatically if a cell within the target changes. If there is no change, then nothing happens. If you don't want it to happen automatically with a change event, then we can set it to occur when you activate a macro. This however, is a manual step that you must invoke.

    Once you make that decision, we can look at the other issues as that will drive how we treat the balance.

  9. #9
    Registered User
    Join Date
    08-19-2021
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    1

    Re: After input, move all rows 1 down

    Quote Originally Posted by alansidman View Post
    In your worksheet, open the VBE (Alt + F11), In the left window, double click on the sheet you are working on. In the window that opens, paste the following VBA code. Everytime you enter data in cells B,C and D, after entering data in D, the macro will insert a new row.

    Please Login or Register  to view this content.
    I am not familiar with Open Office so I don't know if this will work in that environment. It will work with Excel.
    Hi,
    I am using the above file in a modified sort of way. It does work very well. However in the next column I want to absolute cell referrence the rows which have moved down. If I enter $d$5 it accepts it but as soon as I enter a value in the column which moves down by one row, my absolute cell referrence changes to $d$6. How do I work around this?

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,857

    Re: After input, move all rows 1 down

    @Keith Leonard59

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to Move Rows to New Worksheets Based on Criteria & Then HIDE & Move Back
    By abro0821 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2014, 04:00 PM
  2. [SOLVED] Macros To Move Multiple Rows To Another Sheet And Macro To Move Single Rows To DAX Table
    By jcaynes in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2013, 05:08 PM
  3. Replies: 2
    Last Post: 08-27-2013, 05:01 PM
  4. message input box returns lines/rows based on the input
    By excelandclark in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2013, 07:35 PM
  5. have reference cells move in rows while I move in columns
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2011, 09:33 AM
  6. Move Rows Based on Cell Input
    By aegliveinterns in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2010, 02:08 PM
  7. Move rows to another sheet based on column input
    By lacerz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-01-2010, 01:02 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