I’m currently trying to include a VBA code into a larger Macro however one particular line (in Part B) is throwing out an error with the FIND function. The objective of the code is to insert two formulas into two diiferrent cells that extract text string from other cell (this formula is copied down accordingly). Below is what I have to date
' Part A
x = Range("A" & Rows.Count).End(xlUp).Row
sConc = "=B2&"" - ""&XLOOKUP(B2,Table4[Code], Table4[Description])"
Range("J2").Resize(x - 1).Formula = sConc
' Part B
y = Range("B" & Rows.Count).End(xlUp).Row
sConc = (LEFT(G1,FIND(" - ",G1)+1)) ' THIS LINE
Range("K2").Resize(y - 1).Formula = sConc
I gather the FIND function will not work within VBA and I need to use the INSTR function however I cannot figure out how to extract the required text ( before the " - ") from the cell using the INSTR function.
Any help on this would be greatly appreciated
Thanks
Bookmarks