Hi guys,
I am having an issue with saving an active workbook, I get "runtime error 13 type mismatch" when I step through the code. The weird thing is, the file actually saves in the location I want it to, but the code stops with that error message after saving.
Dim start As Range
Dim curmth As String
Dim Depot As Integer
curmth = Sheets("Lookups").Range("M29").Value 'Cell M29 is a formulated cell which retrieves the month which is given in the filename
i = 4
Set start = Sheets("Main List").Range("A" & i)
While start.Value <> ""
Depot = start.Value
If WorksheetFunction.CountIf(Sheets("Claims Summary").Range("A:A"), Depot) > 0 Then
Sheets("Claims Summary").Copy
ActiveWorkbook.SaveAs Filename:= _
"[path]" & Depot & " - Claims Recharges - " & curmth & ".xlsx" _
, FileFormat:=xlOpenXMLWorkbook, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Bookmarks