ByRef argument type mismatch in Excel VBA
I suspect you haven’t set up last_name properly in the caller. With the statement Worksheets(data_sheet).Range(“C2”).Value = ProcessString(last_name) this will only work if last_name is a string, i.e. appears in the caller somewhere. The reason for this is that VBA passes in variables by reference by default which means that the data types have to match exactly between caller and callee. Two fixes: … Read more