Total parts quantity

Total parts quantity

farshidDWRFR
Enthusiast Enthusiast
423 Views
3 Replies
Message 1 of 4

Total parts quantity

farshidDWRFR
Enthusiast
Enthusiast

Hello everybody,

I have assigned 3 types to the parts in an assembly. I have an iLogic snippet that creates 3 separate Excel files from BOM based on these types.  I need to make 2 improvements to my code:

1- To add a row at the end of each table in my Excel sheets under the column QTY that shows the total number of parts in that column. For example, if I have Part1x2, Part2x6, and Part3x12 I need to get a total quantity of 20.

2- The tables in my Excel sheets are long. I have another piece of code that can create separate sheets with 10 rows in each Excel file. I need this code to be integrated into my main code.

I attach both codes so that you can have a look and help me with this.

I appreciate anyone who can assist me.

Farshid

0 Likes
424 Views
3 Replies
Replies (3)
Message 2 of 4

A.Acheson
Mentor
Mentor

For the second task sheet split first you need to convert your code from VBA to VB.Net. I am assuming you assembled that code yourself? If so it should be only a matter of reference the excel dll and and add reference to xl object similar to your first code. Next delete the key word Set. I would suggest to test it complety in isolation before trying to link it into your main code due to its complexity.

 

For the first task you will need to get the last row of column qty and then use a summing formula to sum up the qtys. You might need to handle length units if they are present. In the delete sub routine this has all the receipe to find the last row of the sheet. You can use this as the basis to dertermine the last row. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 4

farshidDWRFR
Enthusiast
Enthusiast

Hi there.

Thanks for your response. I managed it using a VBA code in Excel and save it as a Personal workbook.

Thanks

0 Likes
Message 4 of 4

A.Acheson
Mentor
Mentor

Good stuff having an in depth knoledge of one launguage makes learning a new one much easier. Can you post the attempted conversion of Sub Routine SplitTableIntoSheets()

from vba to vb.net? Attempting the conversion and figuring out what works and doesn't work is a great tool in learning the difference between VBA and VB.Net. It will make any future conversion much easier. Any questions as always just post them to the thread. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes