+ Reply to Thread
Results 1 to 3 of 3

Move text in range to top, and move empty rows down

  1. #1
    Registered User
    Join Date
    06-04-2019
    Location
    London
    MS-Off Ver
    2010
    Posts
    1

    Move text in range to top, and move empty rows down

    I am trying to move text up in a range (A36:G164) when there is empty rows above or in between. Note that the empty rows can not be deleted, the macro needs to move empty rows down and text up. I thought I had got it to work but now I found that it clears and copies the wrong rows.

    Here is an example of the problem with the code I am using now:

    If I got:
    1
    empty
    3
    4
    5

    The outcome should be:
    1
    3
    4
    5

    But now it is:
    1
    3
    3
    4
    (as you can see, 3 is copied and 5 is deleted. The text should just move up).


    Does anyone here have an idea how to fix it?


    The code I am using is this:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Move text in range to top, and move empty rows down

    Try this implementation of MoveTextUp:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,846

    Re: Move text in range to top, and move empty rows down

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Code to move VBred rows to next empty row
    By justlearning123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2015, 07:24 PM
  2. [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
  3. [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
  4. Replies: 2
    Last Post: 08-27-2013, 05:01 PM
  5. [SOLVED] Move Contents of Cells and Eliminate Empty Rows
    By aviatecar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2012, 08:44 PM
  6. 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
  7. move a row into first empty row of a range
    By spencermjax in forum Excel General
    Replies: 1
    Last Post: 01-16-2005, 07:40 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