View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default Cut and Paste Macro.

I Believe it's because you have closed the workbook with .DisplayAlerts
disabled, which tells excel to blow away the large amounts of information in
the clipboard. Try this order instead:
Dim wb1 As Workbook
Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
Set wb2 = Workbooks.Open(strFile)
Selection.CurrentRegion.Copy wb1.Worksheets("All Movements").Range("A1")
wb2.Close
--
Charles Chickering

"A good example is twice the value of good advice."


" wrote:

So I'm having an inputbox pop-up so I can have the data from that sheet
cut and pasted into the new sheet. It all seems to work, but the paste
portion always errors out. Any ideas what I'm doing wrong?

Thanks!

Workbooks.Open Filename:=strFile
Selection.CurrentRegion.Select
Selection.Copy
ActiveWindow.Close
Worksheets("All Movements").Select
Range("A1").Select
ActiveSheet.Paste