I have some VBA code that works well whenever ProjNoB is a number (eg 211147) or has other characters
in it (eg 211147/1), but whenever it contains an alpha character (eg 211147/C) it gives Run Time Error 13.
is declared as a String
WeekNo is a named range formatted as Text in the spreadsheet.
If I put the same formula in a spreadsheet cell it does not error.
Does anyone know why this only errors in VBA
when there is an alpha character in the ProjNoB variable? And how to get around it?
Format(Evaluate("=WORKDAY(" & CLng(ProjEndB) & "," & ProjAdj & "+ SUMIF(WeekNo," & ProjNoB & ", WeekAdj))"), "mm/dd/yyyy")
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines