Private Sub CommandButton1_Click() Dim FSO As Object Dim sourcePath As String Dim destinationPath As String Dim fileExtn As String sourcePath = "H:\Depts\css\A_ILS & Reliability\Reliability\Monthly Reliability Reports\ISEDIS Reports\ISEDIS MTBF MTBUR extractions\1 Latest ISEDIS Results\Special Reports\AAL" destinationPath = "H:\Depts\InFlyt_Informed_Data\LATEST DEVICE REPORTS\AAL-Monthly Report\2019" fileExtn = "*xls" If Right(sourcePath, 1) <> "\" Then sourcePath = sourcePath & "\" End If Set FSO = CreateObject("scripting.filesystemobject") If FSO.FolderExists(sourcePath) = False Then MsgBox sourcePath & " does not exist " Exit Sub End If If FSO.FolderExists(destinationPath) = False Then MsgBox sourcePath & "does not exist" Exit Sub End If FSO.CopyFile Source:=sourcePath & fileExtn, Destination:=destinationPath copy_files_from_subfolders MsgBox "Your files have been copied from " & sourcePath & " to " & destinationPath End Sub
Sub CopyFiles3() Dim Cstmr As String, SrcPth As String, SourcePath As String, DestPath As String, SrcFile As String, i As Long, _ Mnth As String, MnthName As String, MnthName2 As String, SrcFilePDF As String SourcePath = "\\us02fshares03.dom1.taus.us.thales\toledo_share\Depts\css\A_ILS & Reliability\Reliability\Monthly Reliability Reports\ISEDIS Reports\ISEDIS MTBF MTBUR extractions\1 Latest ISEDIS Results\Special Reports\" Mnth = [D2] MnthName = Mnth & "_" & [E2] MnthName2 = [MonthNum2] & "_" & [E2] For i = 2 To [B100].End(xlUp).Row Cstmr = Cells(i, 2) SrcPth = SourcePath & Cstmr & "\" & MnthName & "\" DestPath = "\\us02fshares03\toledo_share\Depts\InFlyt_Informed_Data\LATEST DEVICE REPORTS\" & Cstmr & "-Monthly Report\2019\" SrcFile = MnthName2 & "_2019_" & Cstmr & "_MM_6Mo_Charts.xls" FileCopy SrcPth & SrcFile, DestPath & SrcFile SrcFilePDF = MnthName2 & "_2019_" & Cstmr & "_MM_6Mo_Report.pdf" FileCopy SrcPth & SrcFilePDF, DestPath & SrcFilePDF Next i End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
An Experts Exchange subscription includes unlimited access to online courses.Get Started
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE