BrianM
Well-known Member
- Joined
- Jan 15, 2003
- Messages
- 768
- Office Version
- 2016
- Platform
- Windows
Hello all,
Using VBA, what is a simple line of code to obtain the first name from A1 (John Doe) so that I can set it as a variable?
My brain says
Dim FName as string
FName =LEFT(A2,SEARCH(“ ”,A2)-1) but I know that won't work. I don't want to use a formula in a helper cell to only then set the variable.
Thanks
Using VBA, what is a simple line of code to obtain the first name from A1 (John Doe) so that I can set it as a variable?
My brain says
Dim FName as string
FName =LEFT(A2,SEARCH(“ ”,A2)-1) but I know that won't work. I don't want to use a formula in a helper cell to only then set the variable.
Thanks