If nothing found ...


A

Annette

Another if statements ...

sometimes there is no text that qualifies so this errors out. I need an if
statement that if no text is found in the selection, skip the next section
and move along as written. here's the code:



Range(Selection, Selection.End(xlDown)).Select

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited,
_
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar
_
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1))

Thanks, Annette
 
Ad

Advertisements

F

Frank Kabel

Hi Annette
You may try adding
on error resume next
before this code snipptet

and
on error goto 0
after the last line of your code
 
A

Annette

Again ... Perfect! Thanks and I think that the main macro is now finished.
Just have one final question to post and I'm done!
 
Ad

Advertisements

F

Frank Kabel

Annette said:
Again ... Perfect! Thanks and I think that the main macro is now
finished. Just have one final question to post and I'm done!
:) only one?
thanks for the feedback
Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to deal with Find when nothing is found 1
Is Nothing 4
Nothing? 2
Not Nothing 5
Date to nothing 3
if range=nothing then 2
If Not c Is Nothing Then 3
replacing , with nothing ? 2

Top