+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : .I have data for 1 observation in 2 columns that needs to be in 1 column

  1. #1
    Registered User
    Join Date
    10-11-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    4

    .I have data for 1 observation in 2 columns that needs to be in 1 column

    Hi,

    I am trying to clean up some data before importing it into SPSS. I will attach a sample data to the post to show how the data looks.

    The labels are in column A. The data are in columns B and C. I want to move the data in column C underneath the data in column B.

    I have a number of "paired" columns like this in the spreadsheet. So, column B and C are paired then column D and E are paired, etc. all the way to CP and CQ.

    Any ideas on how I can do this without cutting and pasting them all? Thanks in advance for any help on this.
    Attached Files Attached Files
    Last edited by spotte; 10-13-2010 at 02:07 PM.

  2. #2
    Registered User
    Join Date
    10-11-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: .I have data for 1 observation in 2 columns that needs to be in 1 column

    bumping to the top....anyone have any advice on this question? Thanks in advance for any help you can provide.

  3. #3
    Registered User
    Join Date
    10-11-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: .I have data for 1 observation in 2 columns that needs to be in 1 column

    Okay, I have been playing around with trying to get this data moved around and I was able to make a very simple macro to move the data the way I want, but I don't know the code to make it automate.

    The macro is
    Please Login or Register  to view this content.
    What I would like to be able to do is have this macro run and check all the row 1 columns from C to CR. If the cell is blank then I would like it to execute the macro above, but of course the columns indicated in the macro above would need to change to match whatever column the code has identified as being a blank cell in row 1.

    Anyone have any help for this? I am pretty mych a tyro when it comes to macros and programming in excel. Thanks in advance for any help.
    Last edited by spotte; 10-13-2010 at 11:37 AM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: .I have data for 1 observation in 2 columns that needs to be in 1 column

    Like so:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    10-11-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Red face Re: .I have data for 1 observation in 2 columns that needs to be in 1 column

    @JBeaucaire

    Thank you very much for your reply!

    I ran the code you posted and it works great, but for some reason stops processing after column BD in row 1 when there are still more cells in row 1 that are blank and need to be moved. Any ideas why it might be doing that?

    Thanks!

    Nevermind..I figured it out...for some reason there were spaces in the ones after that. This code works beautifully. Again, really appreciate your help on this JBeaucaire!
    Last edited by spotte; 10-13-2010 at 02:04 PM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: .I have data for 1 observation in 2 columns that needs to be in 1 column

    Glad to help, always enjoy a unique problem to solve.

+ 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