Gilbfernandes
New Member
- Joined
- Jan 26, 2016
- Messages
- 20
Good morning everyone,
I have the following code but I am having problem with it:
New_Name = Split(Sheets("Report").Range("D16"))
FirstName = New_Name(0)
LastName = New_Name(1)
If LastName = "" Then
MsgBox "Please enter Last Name"
GoTo endsub
End If
But if Last Name is not entered on D16 , I get Run-Time Error 9 on LastName=New_Name(1). I don't even know if the IF will work on this case.
Can someone help me?
Thank you in advance.
Gil
I have the following code but I am having problem with it:
New_Name = Split(Sheets("Report").Range("D16"))
FirstName = New_Name(0)
LastName = New_Name(1)
If LastName = "" Then
MsgBox "Please enter Last Name"
GoTo endsub
End If
But if Last Name is not entered on D16 , I get Run-Time Error 9 on LastName=New_Name(1). I don't even know if the IF will work on this case.
Can someone help me?
Thank you in advance.
Gil