+ Reply to Thread
Results 1 to 7 of 7

move range cell data up 1 row to fill in deleted data

  1. #1
    Registered User
    Join Date
    07-01-2018
    Location
    Houston, TX.
    MS-Off Ver
    Office 365
    Posts
    93

    move range cell data up 1 row to fill in deleted data

    I am using Rows 101 - 115 and columns A - C for UserForm data. I allow deleting 1 range of data at a time, that leaves my UserForm a empty row of data. After removing the data from,
    example:

    A102, B102, C102

    I would like to move remaining data up to fill in the empty UserForm row.
    example:

    Row 103's data into Row 102
    Row 104's data into Row 103
    and so on to Row 115, all data starts in row 101, but not all rows contain data, example: row 101- row 104 have data and row 105 - row 115 are empty until more data is entered

    I am using columns D - U, and row 116 for other information


    I have tried
    Please Login or Register  to view this content.
    tried to explain in detail, and i continue to work problem
    thanks in advance

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: move range cell data up 1 row to fill in deleted data

    If I understand the requirement I'd add a line of code to filter just the data rows which have values to a working area. Create a dynamic range name for that working area so that the named range expands and contracts to cover the data.

    Then in your userform use the RowSource property and specify the named range for the List/Combo box you're using
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-01-2018
    Location
    Houston, TX.
    MS-Off Ver
    Office 365
    Posts
    93

    Re: move range cell data up 1 row to fill in deleted data

    was looking for a more graceful solution, but here it is;

    took richards advice

    1)looped through existing range, if it contained data then off to tmp location, erasing current data
    2)looped through tmp location, copied now concurrent data to original location, erasing tmp data
    3)refreshed UserForm data

    Thanks,

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: move range cell data up 1 row to fill in deleted data

    ..one more comment.

    Whilst looping code works, loops should be avoided if there are more elegant and efficient methods. There's a time overhead every time the loop jumps back to the Excel app and again when it returns. In these situations the fastest and most efficient way i know is to use an Advance Filter to extract the data. That requires just one call to the the Excel App.

  5. #5
    Registered User
    Join Date
    07-01-2018
    Location
    Houston, TX.
    MS-Off Ver
    Office 365
    Posts
    93

    Re: move range cell data up 1 row to fill in deleted data

    yes Richard, I understand that, which is why I posted my problem - in an effort to elicit a more graceful and faster(code) solution. I do understand their are many VBA experts that would have approached the problem from a different angle, simply because of the knowledge possessed. The solution I came up with while not graceful, but it worked.

    I post here not only to find help in solving code block but also to gain knowledge from different perspectives.

    Respectfully, Have a good day.

  6. #6
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Re: move range cell data up 1 row to fill in deleted data

    I have a question I posted on the Excel Basics forum that sounds similar to this question. If its OK to piggyback here is what I posted (If not I will start a new thread, I just didnt want to add more threads if I didnt have to):

    I am trying to make a digital bout board for a wrestling tournament. The matches have numbers assigned to them so that fans can track who is wrestling on each mat at any given time. I have seen tournaments use an excel sheet to display this before but have no idea how they did it because they had it set up so that when they entered a new match number on a mat it would automatically slide the other numbers to new cells.

    The set up looks like this:
    Column A | B | C | D | E
    Mat # | Wrestling | On Deck | Warming Up | Bull Pen
    1 | 1 | 4 | 7 | 10
    2 | 2 | 5 | 8 | 11
    3 | 3 | 6 | 9 | 12

    I hope you can visualize that.

    When Match 1 ends on Mat 1 match 13 would go to the Bull Pen section (Manually typed) and 1 then disappears while 4, 7, and 10 slide left.

    Any ideas?

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: move range cell data up 1 row to fill in deleted data

    Yes, would you start your own thread please. These things start to get messy if people are answering slighly different aspects.

    Link back to this thread if necessary.

+ 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: 4
    Last Post: 12-01-2016, 02:50 PM
  2. Macro to calculate data and allow cell data to be deleted
    By stephenanderson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2016, 10:42 PM
  3. Once data in a cell, data cannot be deleted
    By rookie3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2014, 10:42 PM
  4. Replies: 3
    Last Post: 07-10-2014, 12:06 PM
  5. Replies: 5
    Last Post: 02-10-2013, 07:59 AM
  6. [SOLVED] Fill a cell with a data range
    By Deeds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2005, 06:20 PM
  7. Replies: 1
    Last Post: 06-26-2005, 10:05 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