Hi.
I'm trying to program a macro that will run down the first column of a worksheet, counting the number of product names it finds.
The product names are the only items on the worksheet that are in a bold font, so I'm using this attribute to identify them.
The macro moves down the rows by incrementing the variable 'rowNo'.
It keeps a tally of the products in 'prodCount'.
The problem I'm having is that I also want the macro to store all the names of the products it finds into a 1-dimensional array called 'prodList'.
At the end of the macro the product count is displayed via a message box, and this seems to be working okay.
But a second message box that is supposed to display the first and last items in the product list array doesn't show any names have been stored.
Have I set up the array wrong?
Or am I storing the product names incorrectly?
Any help with this problem would be appreciated.
Here is the macro code:
![]()
Please Login or Register to view this content.
Bookmarks