Hello,
I have some code that works in excel but I am trying to get the formula into VBA - I am getting a compile error for invalid character on the "@". The values are in column A and would be output in column B of sheet2. Any help would be great.
Here is the excel formula that works:
=IFERROR(LEFT(A1,FIND("@",SUBSTITUTE(A1,",","@",LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))-1),"")
Below is what I am trying with VBA:
Set calcsheet = Sheets("sheet2")
With calcsheet.Range("b1:B100000")
.FormulaR1C1 = _
"=Left(RC1, Find("@", Substitute(RC1, ",", "@", Len(RC1) - Len(Substitute(RC1, ",", "")))) - 1)"
.Value = .Value
End With
Bookmarks