+ Reply to Thread
Results 1 to 16 of 16

Changing and adding punctuation in a split macro?

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Question Changing and adding punctuation in a split macro?

    Hello,

    I have a macro / module that splits names of a folder into different columns in excel. What I am wondering is if my folder looks like this FRANK^JOE_12341234_19120304 is there a way to get excel to change this ^ to a comma ,or would it be easier to have the name split on the ^? If having the split on the ^ is better how would i add that into my current macro / module? If I need to post the macro i can.

    Thank You
    Last edited by dark91zc; 08-02-2013 at 05:10 PM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Changing and adding punctuation in a split macro?

    Please do..



  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    Here is the macro

    Please Login or Register  to view this content.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Changing and adding punctuation in a split macro?

    I don't think a ^ is allowed in a foldername.

  5. #5
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    I am running Windows 7 32-bit, and the program i am using output the folder names like this. Thank you.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Changing and adding punctuation in a split macro?

    My guess.

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    If I did that would it only split on the ^ or would it still split on the _ ? Sorry I am new to this and trying to learn as i go along for work. Also how do i get it to not split on a Space? Thank you and sorry.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Changing and adding punctuation in a split macro?

    How do you want it?

    Can you show me the folder name and the result that you want?

  9. #9
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    the folders look like this

    DOE^JOHN_12349876_19450125
    SUE^JEFF_95157535_19181221
    SMITH^LEE_84269713_19631124

    In Excel

    Column A will be the persons last name
    Column B will be the persons first name
    Column C will be the first 8 numbers (MDR)
    Column D will be the last 8 numbers (Date of Birth)

  10. #10
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Changing and adding punctuation in a split macro?

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    I just replace my cell 1
    Please Login or Register  to view this content.
    With yours correct?
    Please Login or Register  to view this content.
    Thanks

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Changing and adding punctuation in a split macro?

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    Hello Jindon
    i had tried that and got an error i will find out today.

  14. #14
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    I just ran the code again and it does not even split the folder names it just puts them in one column.

    this is what it looks like
    LEE^CHUE^00343918^19451201
    JANE^MARY^00560803^19430222

    after running the code

    those 4 elements need to be in their own column. but i need to split on the ^ sign as well as the _ sign.

    so column a is the last name
    column b is the first name
    column c is the mdr
    column d is the birthdate
    last name first name mdr date of birth
    lee chue 00343918 19451201
    JANE MARY 00560803 19430222


    thanks
    Last edited by dark91zc; 08-01-2013 at 11:06 AM.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Changing and adding punctuation in a split macro?

    Ahh

    missed delimiter
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Changing and adding punctuation in a split macro?

    Sweet thank you =D

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 02-06-2013, 12:13 AM
  2. Macro to highlight cells which have content with an end punctuation
    By Athi123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2013, 03:04 AM
  3. [SOLVED] Adding punctuation like parentheses or a period
    By sharpmel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2012, 06:07 PM
  4. [SOLVED] Split Macro modification to Split into new Workbooks instead of sheets within one workbook
    By DLSmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2012, 08:11 PM
  5. Adding Punctuation for Columns
    By ajbard in forum Excel General
    Replies: 7
    Last Post: 04-01-2009, 12:55 PM

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