+ Reply to Thread
Results 1 to 8 of 8

Moving text from one range of cells to an empty row in the same sheet:

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Portland, Ore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Moving text from one range of cells to an empty row in the same sheet:

    Here's my situation:

    1.) I have no idea how to code a macro.
    2.) I've run a macro successfully that added an empty row below each already filled row.
    3.) I have a database of information with two sets of contact information in one row, B - Name, C - Title, D- Email, E - Phone, and F - Name, G - Title, H- Email, I - Phone
    4.) I'm trying to move the second set of contact information to the empty row below.

    So, if I have columns B C D E already in place, how do I move the cells in F G H I below B C D E?

    Any help is greatly appreciated! If I had any idea what I was looking at in other answers, I would have put together a macro of my own, but it's a completely foreign language.

    Thank you!

    -Ashley

  2. #2
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Moving text from one range of cells to an empty row in the same sheet:

    Please upload a sample of the data in a workbook with two worksheets: one with the original data sample and one with the data arranged how you'd like. I'm not sure exactly what you are trying to achieve from your post. It sounds like you would just copy and paste the data but that does not involve a macro so I think I've misunderstood.

  3. #3
    Registered User
    Join Date
    08-20-2012
    Location
    Portland, Ore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Moving text from one range of cells to an empty row in the same sheet:

    Hi Yay,

    Yes, it would involve copying and pasting, but with 1,000 records, and ~10 databases, this will take quite a while.

    Attached is a spreadsheet with two tabs, the first being what it looks like now, and the second with what I'd like it to look like.

    Is there not a macro that would run this repetitive process?

    Thanks so much for your reply,
    Ashley

    Sample.xlsx

  4. #4
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Moving text from one range of cells to an empty row in the same sheet:

    Provided the sample data is in the exact same format as the worksheet you uploaded (data is in the same columns and always follows the one-entry-then-one-blank-row pattern), this code will update the active worksheet of your database.

    Please Login or Register  to view this content.
    Good luck!

  5. #5
    Registered User
    Join Date
    08-20-2012
    Location
    Portland, Ore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Moving text from one range of cells to an empty row in the same sheet:

    Awesome! Thank you so much. I was afraid I wasn't asking a macro question with your first reply, but I'm glad it can be done. I will try this out.

    If the data is in a different column, simply change the range referenced in the code?

    -Ashley

    ---------- Post added at 12:57 PM ---------- Previous post was at 12:50 PM ----------

    Also, 1.) It works fabulously. Thank you again! 2.) Is there a way to keep formatting when running the macro? If not, no biggie; it takes just a minute to reformat things, but it would be cool if that could be added in the code somehow.

    Thanks again!

  6. #6
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Moving text from one range of cells to an empty row in the same sheet:

    It is probably faster to format as you like after running the macro rather than apply formatting to every line as the code loops through the entries. I'm glad it works for you.

    If the data is in different columns, changing the letters will work for you as long as the source data columns are in the same order as the destination columns. Does that make sense?

  7. #7
    Registered User
    Join Date
    08-20-2012
    Location
    Portland, Ore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Moving text from one range of cells to an empty row in the same sheet:

    Yes, that makes sense. Thank you again for your help!

    Also, though I've been using the Macro successfully since you provided it, I just received this error today, which is weird: "Run-time error '1004': Method 'Rnag" of object '_Global' failed

    I'm not sure what this means. This hasn't happened before, and I just used the Macro on another database earlier today. Any ideas, if you're able to comment? If not, no worries.

    Thanks again.

    -Ashley
    Last edited by ashleyjean; 09-11-2012 at 07:18 PM.

  8. #8
    Registered User
    Join Date
    08-20-2012
    Location
    Portland, Ore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Moving text from one range of cells to an empty row in the same sheet:

    I guess it was just the data I was working with.. When I pasted the values in a new spreadsheet the macro worked fine. Sorry to bother you!

    -Ashley

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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