+ Reply to Thread
Results 1 to 3 of 3

Text to columns VBA code to change delimiter if the cell value is in array

  1. #1
    Registered User
    Join Date
    11-13-2008
    Location
    Dunfermline, Scotland
    Posts
    25

    Text to columns VBA code to change delimiter if the cell value is in array

    Hi all. I'm currently trying to compare all of my companies data sources for staff, ie helpdesk, telephony, ldap etc. and I have made quite a bit of progress, mostly thanks to this forum, however one issue I am running into, is the fact that when I use the text to columns funtion (in a macro) it's splitting up names which are double barrelled into 3 columns. The names are in the format of...
    Please Login or Register  to view this content.
    ... so its space delimited.

    I was wondering if there is any way to incldue an exceptions file so that we can say, "If the value in A1 does not appear in the exceptions list then split the name using a space separator. Other wise use a comma.

    We would then have the exceptions text file looking along the lines of
    Please Login or Register  to view this content.
    My existing code is as follows which is just put straight into the macro by recording the text to columns function.
    Please Login or Register  to view this content.
    Last edited by dopple; 11-26-2008 at 09:29 AM. Reason: change title to something more meaningful

  2. #2
    Registered User
    Join Date
    11-13-2008
    Location
    Dunfermline, Scotland
    Posts
    25
    I have the array part working now. Now I just need to check if the value of a cell is in the array.

    I have used the function example from the following site.
    http://www.visualbasic.happycodings....es/code54.html
    Last edited by dopple; 11-26-2008 at 05:39 AM. Reason: added requirements

  3. #3
    Registered User
    Join Date
    11-13-2008
    Location
    Dunfermline, Scotland
    Posts
    25
    I've sorted it myself.
    Here's what I ended up doing. I read in the list of excelptions from a text file into an array and then here's the code.
    Please Login or Register  to view this content.

+ 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