In the following code, I am getting error when saving the file...... Please help
Sub Del_Column()
Dim wb As Workbook
Dim wbName As String
wbName = "Book"
For Each wb In Application.Workbooks
If wb.Name Like wbName & "*" Then
Debug.Print wb.Name
wb.Sheets("Sheet1").Name = "D Track"
wb.Sheets("Sheet2").Name = "Comp Yes"
With wb.Sheets("D Track").Range("B:J,L:L,N:T,V:V,X:X,Z:AM,AO:AV").EntireColumn.Delete
wb.Sheets("Comp Yes").Range("B:I,K:K,M:N,P:S,U:U,W:W,Y:AK,AM:AP").EntireColumn.Delete
End With
End If
ActiveWorkbook.SaveAs Filename:="\\Desktop\\Daily Sheet" & Format(Now(), "DDMMMYY") & ".xlsx"
Next wb
End Sub
Sub Del_Column()
Dim wb As Workbook
Dim wbName As String
wbName = "Book"
For Each wb In Application.Workbooks
If wb.Name Like wbName & "*" Then
Debug.Print wb.Name
wb.Sheets("Sheet1").Name = "D Track"
wb.Sheets("Sheet2").Name = "Comp Yes"
With wb.Sheets("D Track").Range("B:J,L:L,N:T,V:V,X:X,Z:AM,AO:AV").EntireColumn.Delete
wb.Sheets("Comp Yes").Range("B:I,K:K,M:N,P:S,U:U,W:W,Y:AK,AM:AP").EntireColumn.Delete
End With
End If
ActiveWorkbook.SaveAs Filename:="\\Desktop\\Daily Sheet" & Format(Now(), "DDMMMYY") & ".xlsx"
Next wb
End Sub