Can an addin save an array or UDT's to workbooks

J

John

I have an addin that when run, it sorts through a Master worksheet of items
we will be purchasing and creates two sets of new worksheets:

Set 1 - worksheets sorted by column MFG(manufacturer); this worksheet has
only items that have a similar value in column A in the master worksheet.
These are formatted as Purchase Orders

Set 2 - worksheets sorted by column Room #; this worksheet has only items
that have a similar value in column B in the Master worksheet

As it is parsing the information, it creates a new sheet tab for every
unique MFG, names the tab the same as the unique name, and then save that
name into a collection of MFG tab names.

Then it does the same for the rooms.

I do this so the user can display only MFG tabs, only Room tabs, or only the
Mastersheet(Hiding all others)

I would like to save these two collections with the workbook, so when it is
re-opened it will still have that information.

I have created two workbook names which get saved with the workbook:

JNum = 5421
JName = "MyJob"
MasterWorkBook.Names.Add Name:="JobNumber", RefersTo:=JNum
MasterWorkBook.Names.Add Name:="JobName", RefersTo:=JName

Is this the best way to do this? And is there a way to save arrays,
collection, UDT's, or classes???
 
J

Jim Rech

I can't say that I followed you 100% but if this is just a question of
hiding/showing worksheets then I don't see why you're messing around with
collections/names, etc. If you can detect what kind of sheet (Room, master,
etc) each sheet is on the fly (say by its name) why not just grind through
the worksheets and hide/show each one according to that?

--
Jim
|I have an addin that when run, it sorts through a Master worksheet of items
| we will be purchasing and creates two sets of new worksheets:
|
| Set 1 - worksheets sorted by column MFG(manufacturer); this worksheet has
| only items that have a similar value in column A in the master worksheet.
| These are formatted as Purchase Orders
|
| Set 2 - worksheets sorted by column Room #; this worksheet has only items
| that have a similar value in column B in the Master worksheet
|
| As it is parsing the information, it creates a new sheet tab for every
| unique MFG, names the tab the same as the unique name, and then save that
| name into a collection of MFG tab names.
|
| Then it does the same for the rooms.
|
| I do this so the user can display only MFG tabs, only Room tabs, or only
the
| Mastersheet(Hiding all others)
|
| I would like to save these two collections with the workbook, so when it
is
| re-opened it will still have that information.
|
| I have created two workbook names which get saved with the workbook:
|
| JNum = 5421
| JName = "MyJob"
| MasterWorkBook.Names.Add Name:="JobNumber", RefersTo:=JNum
| MasterWorkBook.Names.Add Name:="JobName", RefersTo:=JName
|
| Is this the best way to do this? And is there a way to save arrays,
| collection, UDT's, or classes???
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top