Eurekaonide
Active Member
- Joined
- Feb 1, 2010
- Messages
- 433
Dear All
I have the following code which I would like to input the formula =RIGHT($H4,LEN($H4)-FIND(" ",$H4)) This is because I have a series of names and they start with Mr, Miss, Mrs etc and I need to remove this and just have the names. The formula does a wonderful job but I would like to add it into my VBA code when I am manipulating and sorting the data. However when I run it comes back with an error saying the FIND is a sub or function not defined. Any ideas how I can overcome this please?
Sub Test()
LastRow = Range("J" & Rows.Count).End(xlUp).Row 'Sets the last row
Range("L2").Select
Range("L2:L" & LastRow).FormulaR1C1 = Right(RC8, Len(RC8) - Find(" ", RC8))
End Sub
I have the following code which I would like to input the formula =RIGHT($H4,LEN($H4)-FIND(" ",$H4)) This is because I have a series of names and they start with Mr, Miss, Mrs etc and I need to remove this and just have the names. The formula does a wonderful job but I would like to add it into my VBA code when I am manipulating and sorting the data. However when I run it comes back with an error saying the FIND is a sub or function not defined. Any ideas how I can overcome this please?
Sub Test()
LastRow = Range("J" & Rows.Count).End(xlUp).Row 'Sets the last row
Range("L2").Select
Range("L2:L" & LastRow).FormulaR1C1 = Right(RC8, Len(RC8) - Find(" ", RC8))
End Sub