This was the Macro Doc SirCode:Sub STEP10() Dim Wb1 As Workbook, Wb2 As Workbook, WB3 As Workbook Dim Ws1 As Worksheet, Ws2 As Worksheet, WS3 As Worksheet Dim WSM As Worksheet Dim MaxData1 As Long, MaxCol3 As Long, I As Long Dim FPath As String, sFile1 As String Dim Rng As Range Dim bCloseExit As Boolean With Application .EnableEvents = False .ScreenUpdating = False .DisplayAlerts = False End With For I = 1 To 3 Select Case I Case 1 On Error Resume Next Set Wb1 = Workbooks.Open("C:UsersWolfieeeStyleDesktop1.xls") If Err 0 Then bCloseExit = True Else On Error GoTo 0 Set Ws1 = Wb1.ActiveSheet sFile1 = Wb1.FullName End If Case 2 On Error Resume Next Set Wb2 = Workbooks.Open("C:UsersWolfieeeStyleDesktopAlert..csv") If Err 0 Then bCloseExit = True Else On Error GoTo 0 Set Ws2 = Wb2.ActiveSheet End If Case 3 On Error Resume Next Set WB3 = Workbooks.Open("C:UsersWolfieeeStyleDesktopFilesAlertCodes.xlsx") If Err 0 Then bCloseExit = True Else On Error GoTo 0 Set WS3 = WB3.Worksheets.Item(3) End If End Select If bCloseExit Then Wb1.Close savechanges:=False Wb2.Close savechanges:=False WB3.Close savechanges:=False Exit Sub End If Next I MaxData1 = Ws1.Range("A" & Ws1.Rows.Count).End(xlUp).Row - 1 MaxCol3 = WS3.Cells(1, WS3.Columns.Count).End(xlToLeft).Column Set Rng = WS3.Range(WS3.Range("A1"), WS3.Cells(1, MaxCol3)) Rng.COPY Ws2.Range("A1") Ws2.Range(Ws2.Range("A1"), Ws2.Cells(MaxData1, MaxCol3)).FillDown Wb1.Close savechanges:=False WB3.Close savechanges:=False Wb2.SaveAs FileName:=Wb2.FullName, FileFormat:=xlCSV Wb2.Close Set Ws1 = Nothing Set Ws2 = Nothing Set WS3 = Nothing Set Wb1 = Nothing Set Wb2 = Nothing Set WB3 = Nothing With Application .EnableEvents = True .ScreenUpdating = True .DisplayAlerts = True End With End Sub
Bookmarks