Is there an easy way to check if a folder (c:\timecards) and file (timecards.xls) exists. if true continue with sub, if false then create them and continue with sub?
Private Sub btncontinue_Click()
Dim ShName As String
ShName = ActiveSheet.Name
'check if folder\file exists here, create if not and continue
Workbooks.Open filename:= _
"C:\TimeCards\timecards.xls"
Windows("BMtime.xls").Activate
ActiveWindow.WindowState = xlNormal
Sheets(ShName).Select
Sheets(ShName).Copy after:=Workbooks("timecards.xls").Sheets(1)
ActiveWorkbook.Save
ActiveWindow.Close
range("A4:P20,A24:L40,A46:P62,A66:L82").Select
range("A66").Activate
Selection.ClearContents
range("A4").Select
End Sub
Private Sub btncontinue_Click()
Dim ShName As String
ShName = ActiveSheet.Name
'check if folder\file exists here, create if not and continue
Workbooks.Open filename:= _
"C:\TimeCards\timecards.xls"
Windows("BMtime.xls").Activate
ActiveWindow.WindowState = xlNormal
Sheets(ShName).Select
Sheets(ShName).Copy after:=Workbooks("timecards.xls").Sheets(1)
ActiveWorkbook.Save
ActiveWindow.Close
range("A4:P20,A24:L40,A46:P62,A66:L82").Select
range("A66").Activate
Selection.ClearContents
range("A4").Select
End Sub