Good day
I am a newbie and I am desperate.
I keep getting a error type mismatch 13 at runtime but I cannot understand why.
My code is going through the worksheets and I am referencing the codename and I am running into an error.
PLEASE NOTE IT PROCESSES FINE IF I STEP THROUGH THE CODE.
However at runtime I get the type mismatch error.
I have put where it causes the error in **.
my code is
Please please help me.
Let me know if you need any more info
Jo
I am a newbie and I am desperate.
I keep getting a error type mismatch 13 at runtime but I cannot understand why.
My code is going through the worksheets and I am referencing the codename and I am running into an error.
PLEASE NOTE IT PROCESSES FINE IF I STEP THROUGH THE CODE.
However at runtime I get the type mismatch error.
I have put where it causes the error in **.
my code is
VBA Code:
For Each ws In ActiveWorkbook.Sheets
Application.DisplayAlerts = False
swsCode = Mid(ws.CodeName, 6, 2)
' If swsCode = "" Then MsgBox "It's empty"
' If swsCode = "" Then swsCode = "1"
' MsgBox swsCode
** iwsCode = CInt(swsCode) **
If iwsCode > 5 Then
ws.Copy
xfile = FolderPath & "\" & Application.ActiveWorkbook.Sheets(1).Name & ".csv"
ActiveWorkbook.SaveAs xfile, FileFormat:=xlCSV
ActiveWorkbook.Close savechanges:=False
End If
Next
Please please help me.
Let me know if you need any more info
Jo
Last edited by a moderator: