This VBA is an example of that loops through selected worksheets in a workbook, deletes the top ten rows and exports it as a CSV.
Dim ws As Worksheet
Dim path As String
path = ActiveWorkbook.path & "\" & Left(ActiveWorkbook.Name, InStr(ActiveWorkbook.Name, ".") - 1)
' Loop through all selected sheets.
For Each ws In ActiveWindow.SelectedSheets
IF ws.name <> "Monday" then
ws.Rows("1:10").Delete ' Delete 10 rows at top of each sheet.
Range("A1").Interior.Color = 1 ' Format A1 so the top rows are included in the used range and saved
ActiveWorkbook.SaveAs Filename:=path & "_" & ws.Name & ".csv", FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.Close SaveChanges = False
Looking for business solutions to automate your Excel files? Please contact us through Excel Automation services page.
Our experts will be glad to help you, If this article didn't answer your questions.