Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ignore Blanks in Countifs statement | Excel Worksheet Functions | |||
How to find avg for step size? | Excel Worksheet Functions | |||
Find certain text in a column and return statement | Excel Worksheet Functions | |||
how to step thru only one subfolder of a folder to find like files | Excel Programming |