Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default setting delimiters for pasted data

Hello,
I have a macro that includes a text to columns operation using space as the
delimiter. After running the macro, when I paste more data into an Excel
spreadsheet space is still being used as the delimiter until I shut down and
re-launch Excel. Is there a statement that I can add to my macro that
would reset the delimiter for pasted data to tab?

TIA,

Tom


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default setting delimiters for pasted data

Excel likes to help by remembering settings from the last data|text to columns
that you've used.

I think I'd run a dummy data|text to columns, delimited, but remove all the
checkmarks.

This will reset excel's "memory".

You could even do it in code:

Option Explicit
Sub testme()

Dim dummyCell As Range

With ActiveSheet
Set dummyCell = .Cells.SpecialCells(xlCellTypeLastCell).Offset(1, 1)
End With

dummyCell.Value = "asdf"

dummyCell.TextToColumns Destination:=dummyCell, _
DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, _
Other:=False, FieldInfo:=Array(1, 1) ', TrailingMinusNumbers:=True

dummyCell.ClearContents

'try to reset last used cell
Set dummyCell = ActiveSheet.UsedRange

End Sub



Tom Harvey wrote:

Hello,
I have a macro that includes a text to columns operation using space as the
delimiter. After running the macro, when I paste more data into an Excel
spreadsheet space is still being used as the delimiter until I shut down and
re-launch Excel. Is there a statement that I can add to my macro that
would reset the delimiter for pasted data to tab?

TIA,

Tom


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default setting delimiters for pasted data

Thanks for the suggestions Dave. I will give it a try. I was a little
surprised there isn't some simpler (fewer lines) code to do something like
this, but sometimes things are just not as simple as one imagines.

Tom
"Dave Peterson" wrote in message
...
Excel likes to help by remembering settings from the last data|text to
columns
that you've used.

I think I'd run a dummy data|text to columns, delimited, but remove all
the
checkmarks.

This will reset excel's "memory".

You could even do it in code:

Option Explicit
Sub testme()

Dim dummyCell As Range

With ActiveSheet
Set dummyCell = .Cells.SpecialCells(xlCellTypeLastCell).Offset(1,
1)
End With

dummyCell.Value = "asdf"

dummyCell.TextToColumns Destination:=dummyCell, _
DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, _
Other:=False, FieldInfo:=Array(1, 1) ', TrailingMinusNumbers:=True

dummyCell.ClearContents

'try to reset last used cell
Set dummyCell = ActiveSheet.UsedRange

End Sub



Tom Harvey wrote:

Hello,
I have a macro that includes a text to columns operation using space as
the
delimiter. After running the macro, when I paste more data into an Excel
spreadsheet space is still being used as the delimiter until I shut down
and
re-launch Excel. Is there a statement that I can add to my macro that
would reset the delimiter for pasted data to tab?

TIA,

Tom


--

Dave Peterson



Reply
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
VLookup pasted data Mick Excel Discussion (Misc queries) 5 June 19th 08 01:55 PM
Help! data from pasted table is not included in sum campli Excel Worksheet Functions 5 January 12th 06 08:54 PM
Parse data with uneven lengths and different delimiters [email protected] Excel Worksheet Functions 3 January 5th 06 11:57 PM
Validating data pasted into worksheet Tom F. Excel Discussion (Misc queries) 3 July 20th 05 06:05 PM
Extracting data with delimiters Tippy[_2_] Excel Programming 1 March 5th 04 09:53 AM


All times are GMT +1. The time now is 07:38 AM.

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"