paste special over copy data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good Morning,

I have the following macro which works great except the paste section is
pasting over the copy so it asks if I want to replace. The answer will
always be yes but I don't know how to add that as part of the macro and
record doesn't seem to capture that mouse click. Thoughts?

Sub ConvertTargetDate()
'
' ConvertTargetDate Macro
'

'
Columns("E:F").Select
Selection.Insert Shift:=xlToRight
Columns("D:D").Select
Selection.TextToColumns Destination:=Range("D1"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:=" ", FieldInfo:=Array(1, 3), TrailingMinusNumbers:=True
Columns("E:F").Select
Selection.Delete Shift:=xlToLeft
Range("D9:D5000").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("D:D").Select
Application.CutCopyMode = False
Selection.NumberFormat = "m/d/yyyy"
Range("D9").Select
End Sub
 
Turn off the display alerts like this:

Application.DisplayAlerts = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.DisplayAlerts = true

and then turn them back on again.

FunkySquid
 

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

Back
Top