Replace destination cells

S

SmilingPolitely

When, in my macro, the code gets to this line:

Columns("AA").TextToColumns Destination:=Range("AB1"),
DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1),
Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1),
Array(8, 1), Array(9, 1)), TrailingMinusNumbers:=True

I am asked whether I want to replace the contents of the destination.
As I always want to do this, is there a way I can have this happen, and
avoid the user prompt?


Thanks in advance.
 
T

Trevor Shuttleworth

Try:

Application.DisplayAlerts = False
' your code
Application.DisplayAlerts = True

Regards

Trevor
 
N

Nigel

Wrap the code with

Application.DisplayAlerts = False
'your code
Application.DisplayAlerts = True

HTH
Cheers
Nigel
 

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

Top