+ Reply to Thread
Results 1 to 4 of 4

Macro to parse thru csv file & change value in a column to a substring value

  1. #1
    Registered User
    Join Date
    12-08-2009
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro to parse thru csv file & change value in a column to a substring value

    Hello,

    I work for the school system in Louisville, KY. We are using third party software to conduct a staff survey. I can export the responses to this survey into a CSV file. One of the things I need to do is read a column that contains the respondants location (i.e., Rangeland - 123) and change the value to only be the location number -- the three-digit value at the end of the location (123 in the above example).

    I would like to create a macro that does this for me. The two challenges I have bumped into are: 1) How to create a macro that is based on a dynamic # of incoming records; and 2) how to not make the function I'm using a recursive call. The location column will be F, and I have created this function that works if I use it from another column, but I get fussed at for it being recursive if I try to run it from the cell for which it's intended:

    Please Login or Register  to view this content.
    Any help with one or both of my issues would be very greatly appreciated!!

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Macro to parse thru csv file & change value in a column to a substring value

    How does this work for you:

    Please Login or Register  to view this content.
    Put this sub in a standard module. You must have the csv. file open and active.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    12-08-2009
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to parse thru csv file & change value in a column to a substring value

    Dave,

    As a Seahawks fan, this is really hard for me to say to a 49ers fan...but You Da Man!!

    I'm new to Excel Macros...but this works perfectly. Thank you so much for your help, it is very much appreciated!!

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Macro to parse thru csv file & change value in a column to a substring value

    You're welcome.
    And by the way, I wouldn't think it'd be too hard after this last Sunday, and I'd love to say something about the officiating, but we'll leave that for a different type of forum ; )

+ 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