I'm trying to get the right most letter from a variable I have set and then assign either Male or Female to the result. Below is a snippet of the code I've tried.
Set Gender = rFirst.Offset(1, 5)
Worksheets("E'ee Details").Range("E1").Value = "=if(right(" & Gender & ",1)=""M"",""Male"",if(right(" & Gender & ",1)=""F"",""Female"",""""))"
This is resulting in #NAME? being displayed.
Genderinto your formula, as a cursory examination of the formula will tell you, which the sheet will not understand. You need to use the address property to return the cell reference.GendertoGender.addressand it should work fine.