+ Reply to Thread
Results 1 to 4 of 4

Macro to cleanup data

  1. #1
    Registered User
    Join Date
    06-19-2008
    Posts
    2

    Macro to cleanup data

    Every month I have to create some recurring reports. I am using macros to do most of the leg work, but I am still having an issue when doing data cleanup.

    I receive the data in the format like this:

    lastname, firstname/LocationCode 123,123,123

    Example for John Doe from Seattle:
    Doe, John/SEA 123,123,123
    As part of how the reports have to look like the name information goes into colum A, the volume data goes into column B, and the location code goes into column C.

    Example
    Column A Column B Column C
    Doe, John 123,123,123 SEA
    I can separate the name and data into the 2 columns when importing the CSV data, but how can I separate the location code "/SEA" from the name and dump into its own column?

    Any help would be welcome.

    Thanks.

    Chris

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please read the Forum Rules about thread titles, and then edit your thread title to be descriptive of your problem.

    You can use the Instr function to locate the slash, and then Left and Right to retrieve the pieces, or use the Split function.

  3. #3
    Registered User
    Join Date
    06-19-2008
    Posts
    2
    Thanks. Just noticed someone already improved my thread title. It's appreciated.

    Can I use "Instr function" inside a macro? I thought it needs to be tied to a specific cell?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    InStr is a VBA function; it can only be used in a macro.

+ 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