bloodmilksky
Board Regular
- Joined
- Feb 3, 2016
- Messages
- 202
Hi Guys,
I have a macro that enters the application username as per below. but one of the users names comes up with a dash and I am trying to say that if the username comes up with the dash then replace it with the name in the statement. but it keeps coming up with an error.
can anyone help please?
I have a macro that enters the application username as per below. but one of the users names comes up with a dash and I am trying to say that if the username comes up with the dash then replace it with the name in the statement. but it keeps coming up with an error.
can anyone help please?
Code:
Sheets("Request Form").Select Range("B7").Select
Selection.ClearContents
Sheets("Request Form").Select
Range("B7").Select
Range("B7") = Application.UserName
If Sheets("Request Form").Range("B7").Value ("James Charles-Bradfield") Then.("RJames Charles Bradfield")