Need some help fine tuning this code which will copy an entire worksheet into an open workbook, copy the imported worksheet to a Worksheet named "Posting" and then delete the imported worksheet. I would like to modify the code to open a drop down of all the Excel files in the Folder "C:\MFG_STATISTICS\NYC\NYC_Charts so that I can select the file to be imported and also stop the message "Data may exist in the sheet(s) selected for deletion. To permanently delete the data press delete." after the code. Thanks!!
ActiveWindow.SelectedSheets.Delete
is run.
Sub Import_Worksheet()
'
' Import_Worksheet Macro
'
ChDir "C:\MFG_Statistics\NYC"
Workbooks.Open Filename:= _
"C:\MFG_Statistics\NYC\NYC_Charts.xlsx"
Sheets("Sheet1").Select
Sheets("Sheet1").Copy Before:=Workbooks("NYC_CHARTS.xlsm").Sheets(1)
Sheets("Posting").Select
Selection.Copy
Sheets("Sheet1").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Posting").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Application.CutCopyMode = False
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete
End Sub
Bookmarks