I want to use the below excel formula in SW-Bom table. Since it is not an excel based Bom table, i am not able to make it happen in the SolidWorks BOM.

=LEN(ITEM NO.)-LEN(SUBSTITUTE(ITEM NO.,CHAR(46),""))+1

Any help would be greatly appreciated.

I want to use the below excel formula in SW-Bom table. Since it is not an excel based Bom table, i am not able to make it happen in the SolidWorks BOM.

=LEN(ITEM NO.)-LEN(SUBSTITUTE(ITEM NO.,CHAR(46),""))+1

Any help would be greatly appreciated.

Hi Pradhuman,

goto Issue with BOM Macro and add use VBA replace & length function then write back into cell. The cell value is static after that and BOM updates require to run the code again.

Elmar

I am beginner in VBA, so not getting what that is. Can a macro help me insert my formula in the BOM column.

Hi Yash,

SW Bom's don't offer text manipulation equations like you can use in EXCEL. The macro will do all the math in the background and simply add the resulting level index into a cell or newly added column. That's why it is static meaning you need to run the code every time your BOM changes to update the index value.

Elmar

Hello Elmar

This is what I did

I want to apply the formula in the 5 column.

the 5th column should give results

1

2

2

3

// Simply adding the numeric values from 1st column

______________________________________________

So i recorded a macro, by going to the cell and pressed "1". Now how do I write the excel formula.

Go to Replace Function and read up on that function. Make a new string variable and use the replace call then compare the length of that string with the original. The length difference is your level.

Elmar

The Problem is almost same here

Add custom column with formula to BOM table