+ Reply to Thread
Results 1 to 4 of 4

Help with Advanced Filtering/Data Formatting

  1. #1
    Registered User
    Join Date
    06-06-2011
    Location
    SC, USC
    MS-Off Ver
    Excel 2003
    Posts
    2

    Help with Advanced Filtering/Data Formatting

    Hello all,

    I've just received a delimited data set from a web app and the data is incorrectly formatted. If the user did not enter data into a field it skipped the field. All of my data has been imported and it has a prefix before the data (ie First-Name:, State:, Zip: ) in each cell then the value.

    I need to move each value with a certain prefix to a new column, ie moving all data in the worksheet containing First-Name: to column A, Last-Name: to column B and so on so that the data is formatted correctly. I've tried to do this via the filtering and advanced filter to no avail. I'm also a macro newbie and not sure how to put one in that would manually do this for each prefix I need. Any help is greatly appreciated. Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Help with Advanced Filtering/Data Formatting

    Hi

    Attach an example of your existing data, and what you would like to see as an output.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  3. #3
    Registered User
    Join Date
    06-06-2011
    Location
    SC, USC
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Help with Advanced Filtering/Data Formatting

    I have attached some sample data. In the sample, I would like to move all data in cells that contain the string "City:" to Column D1, all cells with "State:" to E1 and all cells with "Zip:" to F1.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Help with Advanced Filtering/Data Formatting

    Hi

    I inserted some columns before your data, and titled up column D as City, E as State and F as Zip

    then the following code looks for the required data, and moves it to the correct cell location, and deletes the original.
    What you will be left with in columns G, H and I will be any entries that did not contain City Sate or Zip Code.

    Please Login or Register  to view this content.
    I also put a copy of your data in columns L:O (just for testing - so I could copy the data back again to re-run the macro)
    Attached Files Attached Files

+ 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