Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Statement to ignore step if does not find text to Split

How can I put a statement that if the macro does not find text to split when
I call text to column; just ignore it and continue with the program?
The problem is that I got the following message when the macro does not find
data:

Run-Time Error'1004':
No data was selected to parse

Then when I click debug it is highlighting at the following statement:

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1)), TrailingMinusNumbers:=True

Thanks in advance.
Maperalia

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Statement to ignore step if does not find text to Split

On Error Resume Next
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1)), TrailingMinusNumbers:=True
On Error goto 0

--
Regards,
Tom Ogilvy


"maperalia" wrote:

How can I put a statement that if the macro does not find text to split when
I call text to column; just ignore it and continue with the program?
The problem is that I got the following message when the macro does not find
data:

Run-Time Error'1004':
No data was selected to parse

Then when I click debug it is highlighting at the following statement:

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1)), TrailingMinusNumbers:=True

Thanks in advance.
Maperalia

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Statement to ignore step if does not find text to Split

Tom;
Thanks you very much it is working perfectly!!!!!

Kind regards

Maperalia

"Tom Ogilvy" wrote:

On Error Resume Next
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1)), TrailingMinusNumbers:=True
On Error goto 0

--
Regards,
Tom Ogilvy


"maperalia" wrote:

How can I put a statement that if the macro does not find text to split when
I call text to column; just ignore it and continue with the program?
The problem is that I got the following message when the macro does not find
data:

Run-Time Error'1004':
No data was selected to parse

Then when I click debug it is highlighting at the following statement:

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1)), TrailingMinusNumbers:=True

Thanks in advance.
Maperalia

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
Ignore Blanks in Countifs statement Kcope8302 Excel Worksheet Functions 4 February 12th 09 08:24 PM
How to find avg for step size? Omkar Excel Worksheet Functions 7 June 17th 06 04:01 PM
Find certain text in a column and return statement TelecomAuditor Excel Worksheet Functions 4 August 22nd 05 11:00 PM
how to step thru only one subfolder of a folder to find like files foamfollower Excel Programming 1 November 11th 03 08:40 PM


All times are GMT +1. The time now is 06:30 PM.

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

About Us

"It's about Microsoft Excel"