Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    190
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Text to Columns Annoyance - Excel 07

    Hi,
    I have an annoyance with Text to Columns - it interferes with my normal Pasting of data.

    Once a week I use Text to Columns to import data, and I put a tick in the space box as I want the separation into cells to be done by spaces. This works fine, but when I subsequently Paste any other data in Excel the space box is still ticked and my data is separated out by the spaces as if I was using Text to Columns.

    I have to do a separate dummy Text to Columns operation to remove the tick in the space box to Paste my data correctly.

    How can I avoid this situation?

    I tried recording a macro for the dummy Text to Columns, but because I cancel it after the Tick is removed from the space box, there is no code produced to modify or use!

    Any suggestions gratefully received.

    Peter Moran

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,058
    Thanks
    196
    Thanked 765 Times in 699 Posts
    Peter,

    Try this code:
    Code:
    Sub CLRTextToColDelims()
        Selection.TextToColumns Destination:=Range("A1"), _
           DataType:=xlDelimited, _
           TextQualifier:=xlDoubleQuote, _
           ConsecutiveDelimiter:=False, _
           Tab:=False, _
           Semicolon:=False, _
           Comma:=False, _
           Space:=False, _
           Other:=False, _
           FieldInfo:=Array(1, 1), _
           TrailingMinusNumbers:=True
    End Sub
    HTH
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  4. The Following User Says Thank You to RetiredGeek For This Useful Post:

    petermoran (2014-07-31)

  5. #3
    Platinum Lounger
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    3,506
    Thanks
    7
    Thanked 220 Times in 208 Posts
    'Tis a pity you have to resort to scripting it when a menu option would have been simpler.

    cheers, Paul

  6. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    190
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi,

    Works perfectly!

    Many thanks RetiredGeek.

    Thanks to you the Forces of good computing are obviously with me!

    Peter Moran

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •