LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Text to columns -- reset delimiters, etc

I came up with this. It's called from my Workbook_Open routine. It seems like
a kludge. Does anybody have a better solution?

Sub SetDelimiters()
Dim Rng As Range
Set Rng = Worksheets("Sheet1").Range("Dummy") 'a normally empty cell
With Rng
.Value = "XXX"
.TextToColumns Destination:=Rng, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, _
Tab:=True, Semicolon:=False, Comma:=False, Space:=False, Other:=False
.ClearContents
End With
End Sub



On Wed, 29 Sep 2004 22:47:26 -0500, Myrna Larson
wrote:

If you have used Data/Text to Columns, Excel remembers what your settings

were
for delimiters, etc.

Here's my predicament. I had used the Text to Columns on some data that I had
pasted into a worksheet from a newsgroup message, using the space delimiter.

Then I closed that workbook and opened one of my own workbooks without
restarting Excel in between.

In my workbook, I need to paste some tab-delimited data that I copy to the
clipboard in MS Money. Normally, I just copy the data in Money, switch to
Excel, and press CTRL+V to paste. I don't have to use Text to Columns at this
point.

Tonight, the parsing was all messed up because and XL "remembered" that I had
set the Text to Columns delimiter to a space, and it was using those same
settings to parse the new data pasted from the clipboard.

I fixed the problem by closing Excel, restarting, opening the workbook again,
and pasting.

Is there a way, in code, to re-set Text to Columns back to the defaults, or
just to change the delimiter, other than by opening a text file? I can't find
any references to these settings other than the arguments to the OpenText
method.

Or do I have to restart Excel? Or stop messing around with data from newgroup
messages <g?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of multiple-character delimiters under Text To Columns wildetudor Excel Discussion (Misc queries) 3 March 16th 09 09:41 PM
Text-to-columns, but only 1st 2 & last delimiters Paul Excel Discussion (Misc queries) 5 March 26th 08 01:55 AM
Export (or save as) .csv with text delimiters CarolineP Excel Discussion (Misc queries) 2 February 17th 05 02:25 AM
How To Import Text File With No Delimiters? Sam Excel Discussion (Misc queries) 1 February 8th 05 05:54 PM
How do I get carriage returns to not be row delimiters in text fi. RV Excel Discussion (Misc queries) 1 December 16th 04 11:47 PM


All times are GMT +1. The time now is 10:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"