Hi all, i'm not very good at macros, was hoping someone could help me turn the below 2 macros into 1.
Windows("1a.csv").Activate
Range("A4:G1048570").Select
Selection.ClearContents
Range("D3").Select
ActiveWorkbook.Save
ActiveWindow.Close
MsgBox ("File 1A Has Been CLEARED and CLOSED")
End Sub
Sub DeleteFiles()
'
' DeleteFiles Macro
'
Dim fName As String
fName = Dir("C:\CSVToday\*.*")
Do While fName <> "" & ""
If fName <> "1a.csv" Then 'or .txt or .csv or whatever
Kill "C:\CSVToday\" & fName
End If
fName = Dir
Loop
Range("A1").Select
MsgBox ("All Files Hvae Been Deleted")
End Sub
Windows("1a.csv").Activate
Range("A4:G1048570").Select
Selection.ClearContents
Range("D3").Select
ActiveWorkbook.Save
ActiveWindow.Close
MsgBox ("File 1A Has Been CLEARED and CLOSED")
End Sub
Sub DeleteFiles()
'
' DeleteFiles Macro
'
Dim fName As String
fName = Dir("C:\CSVToday\*.*")
Do While fName <> "" & ""
If fName <> "1a.csv" Then 'or .txt or .csv or whatever
Kill "C:\CSVToday\" & fName
End If
fName = Dir
Loop
Range("A1").Select
MsgBox ("All Files Hvae Been Deleted")
End Sub