+ Reply to Thread
Results 1 to 9 of 9

Splitting cells by non-printable characters

Hybrid View

  1. #1
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Splitting cells by non-printable charaters

    Try this:
    Sub SplitByCharacter()
    Columns("A:A").SpecialCells(xlCellTypeConstants, 2).TextToColumns Destination:=Range("A1"), _
        DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Other:=True, OtherChar:=Chr(10)
    End Sub
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  2. #2
    Registered User
    Join Date
    10-31-2008
    Location
    England
    MS-Off Ver
    MS 2013
    Posts
    42

    Re: Splitting cells by non-printable charaters

    Thanks JBeaucaire,

    I knew this day would come - I've not had to play with VBA since college!

    I understand to a degree the code you've written; in that I can see you stipulate a range and the conditions of the split, but unfortunately I've never had to apply any VBA in Excel and am not sure how?!

    I had the top cell of a blank row selected, opened VBA, pasted the data into the window of a new module (is this right?) and adjusted the range from A:A and destination range to suit, but when I clicked to run I got a run-time error '1004' stating that my command couldn't be run for multiple selections?

    Thanks for your swift response.

+ 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