We have a software (Solidworks) from wich we extract a Bill of Materials in an Excel spreadsheet.
It returns the following data:
I would like to create a VBA macro that populates column C (parent) with the parent part number. For exemple cell C6 would display : 101-07798-111.
I managed to do it with an Excel formula directly in the worksheet, however I would like to do it with a VBA macro.
The excel formula requires 2 columns. "Column D" in wich I do a concatenate of a letter and the data of "column A". "Column E" wich does an Index(match) search of "column A" data to return the value of "Column B".
Column D formula : =CONCATENATE("A";A3) *without this step the main formula have errors
Column E formula : =INDEX($B$1:$B$250;MATCH((IFERROR(LEFT(D3; FIND("$"; SUBSTITUTE(D3; "."; "$"; LEN(D3)-LEN(SUBSTITUTE(D3; "."; ""))))-1);"-"));$D$1:$D$250;0))
I found ways to have a VBA script populate the rows with the formula; however since the formula contain a lot of " it causes error in the script.
What could be the best way to use the data in "column a" to get the value of "column B" in a vba script?
Thank you