I am trying to execute a macro to create and extract name variable using MsgBox. I have tried to run it without '_' in the MsgBox code, it didn't work. It shows a message that there is a syntax error in the code defining name equal to Steve Jobs.
Sub test1()
Dim name as string, lname as string, fname as string
name = “Steve Jobs”
lname = right(name, 4)
fname = left(name,5)
Msgbox “First name is” & fname & “” & “ the number of characters are” & len(fname)
Msgbox “Surname is” & fname & “” & “ the number of characters are” _ & len(fname)
End Sub
"versus” “