I'm very new to R1C1, and I'm trying to split a name at the comma and use chr(10) between the first and last name.
This is my starting point
Next I created a few helper columns
My goal would be the final result in 2,9 aka I2
I tried
This is my starting point
2.xls | |||
---|---|---|---|
F | |||
2 | Martinez, Ernesto | ||
Report |
Next I created a few helper columns
VBA Code:
Cells(2, 10).FormulaR1C1 = "=RIGHT(RC[-4],FIND("","",RC[-4])-2)"
Cells(2, 11).FormulaR1C1 = "=LEFT(RC[-5],FIND("","",RC[-5])-1)"
Cell Formulas | ||
---|---|---|
Range | Formula | |
J2 | J2 | =RIGHT(F2,FIND(",",F2)-2) |
K2 | K2 | =LEFT(F2,FIND(",",F2)-1) |
My goal would be the final result in 2,9 aka I2
Cell Formulas | ||
---|---|---|
Range | Formula | |
J2 | J2 | =RIGHT(F2,FIND(",",F2)-2) |
K2 | K2 | =LEFT(F2,FIND(",",F2)-1) |
I tried
VBA Code:
Cells(2, 9).FormulaR1C1 = "=RIGHT(RC[-3],FIND("","",RC[-3])-2)" & Chr(10) & "=LEFT(RC[-3],FIND("","",RC[-3])-1)"
Cells(2, 9).FormulaR1C1 = "=RIGHT(RC[-3],FIND("","",RC[-3])-2)" & Chr(10) & "LEFT(RC[-3],FIND("","",RC[-3])-1)"
Cells(2, 9).FormulaR1C1 = "=RC[1]" & Chr(10) & "=RC[2]"
Cells(2, 9).FormulaR1C1 = "=RC[1]" & Chr(10) & "RC[2]"