![]() |
Cut and Paste Macro.
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 |
Cut and Paste Macro.
|
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 |
Cut and Paste Macro.
|
All times are GMT +1. The time now is 05:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com