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.
The Problem is almost same here
Add custom column with formula to BOM table
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.
I am beginner in VBA, so not getting what that is. Can a macro help me insert my formula in the BOM column.
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.
This is what I did
I want to apply the formula in the 5 column.
the 5th column should give results
// 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.
Thanks Elmar for your efforts, But I Think I need some time to understand all this. I will revert when i get these in my head.
Retrieving data ...