+ Reply to Thread
Results 1 to 9 of 9

Help reformatting block data into standard columns

  1. #1
    Registered User
    Join Date
    06-26-2006
    Location
    New York
    MS-Off Ver
    Office Pro 2003 primarily, some 2007
    Posts
    85

    Help reformatting block data into standard columns

    I have a workbook with 26 worksheets full of address information in block format in 2 columns. Column A has the labels and column B has the data, looking something like the below:

    Column A Column B
    1.Name Acme Corp
    Address 123 Main St
    Phone # 555.867.5309

    2.Name Widgets, Etc...
    Address 1600 Pennsylvania Ave
    Phone# 555.555.1212

    I have about 100 addresses on each worksheet in the above format. I'd like to get all this information onto one page with column headers for name, address, phone, etc...

    I can get the names into a list fairly easily using vlookup, because they have unique identifiers, 1.name, 2.name, 3.name, etc...but the rest of the labels in column 1 are not unique. Any thoughts on how to approach reformatting this workbook?

    Thanks,
    Dylan
    Last edited by dylanemcgregor; 06-03-2009 at 02:13 PM.

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

    Re: Help reformatting block data into standard columns

    I can write a quick macro to do it, are those your only three fields? If you post ALL the needed matching fields this would be a quick macro.

    Is field 1 really 1.Name, then 2.Name, 3.Name, etc.?
    Last edited by JBeaucaire; 06-02-2009 at 09:33 PM.
    _________________
    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!)

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

    Re: Help reformatting block data into standard columns

    As i said this is a pretty quick macro. You implied the data was in a set form, and your post hinted there might be a blank space between each set of 3 rows making up a data set. This macro assumes the data starts on row ONE on each sheet.
    Please Login or Register  to view this content.
    Create a blank sheet called "Master", put the Name, Address, Phone headers in row 1, then run this macro.

    If there is NOT a blank row between each set of data, then change the RED part to "Step 3"
    Attached Files Attached Files
    Last edited by JBeaucaire; 06-02-2009 at 09:57 PM. Reason: Add example workbook

  4. #4
    Registered User
    Join Date
    06-26-2006
    Location
    New York
    MS-Off Ver
    Office Pro 2003 primarily, some 2007
    Posts
    85

    Re: Help reformatting block data into standard columns

    JBeaucaire, thank you very much for your prompt response. I was unfortunately a bit incomplete in my original post in an attempt to simplify what I was trying to do. The data is mostly in a set form, but all fields are not available for all companies, and when they are not there the row is omitted. So the first company might be 12 rows worth of data, and the second company will have 10 rows of data. Also, the address is spread out on 3,4,or 5 rows, but only the first address row will have a label, so it will look like this

    Column A Column B
    Address 1234 1st St
    New York, NY 10001
    USA

    I don't understand macros very well, but I think that what yours is doing is assuming that there would always be just the 3 pieces of data?

    Edited to upload sample file
    Attached Files Attached Files
    Last edited by dylanemcgregor; 06-03-2009 at 07:36 AM.

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

    Re: Help reformatting block data into standard columns

    And your sample layout of what you want your master sheet to be? Layout the exact columnar format as I will create a macro to fill it in based on your design.

    You can add a second sheet to the one you uploaded if you wish...name it something like Contacts.

  6. #6
    Registered User
    Join Date
    06-26-2006
    Location
    New York
    MS-Off Ver
    Office Pro 2003 primarily, some 2007
    Posts
    85

    Re: Help reformatting block data into standard columns

    Thank you JBeaucaire for your generous offer of assistance. I have edited the sample list.xls workbook and uploaded to my previous post. It contains one worksheet with the source data on sheet "A', and the worksheet that data should be output to "Contacts"

    Again I greatly appreciate your help with this. Do you accept donations via Paypal? I know I cannot pay nearly what this is worth, but I would be happy to send you $10 if you PM me your paypal info.

    Best regards,
    Dylan

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

    Re: Help reformatting block data into standard columns

    This should do it. I removed the one column that collated nothing but dashes, so there are 7 columns total now.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JBeaucaire; 06-03-2009 at 08:42 AM.

  8. #8
    Registered User
    Join Date
    06-26-2006
    Location
    New York
    MS-Off Ver
    Office Pro 2003 primarily, some 2007
    Posts
    85

    Re: Help reformatting block data into standard columns

    Wow! That worked perfectly. I'm going to have to spend some time going through the macro so I can understand exactly how it does what it does. Thank you, thank you thank you!

    As I said before I'd be happy to send you a little something via Paypal or another way if you like. Just send me a PM.

    Cheers,
    Dylan

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

    Re: Help reformatting block data into standard columns

    I had never used the InStr() function myself, so your issue and the mildly varying nature of your data and match strings made that the only way to make it work.

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].



    (Also, use the "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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