DixiePiper
New Member
- Joined
- Oct 19, 2015
- Messages
- 41
- Office Version
- 365
- Platform
- Windows
I need to know if/how I can take a generated array and store it for later use. The application I'm building is specific to my industry so please be patient as I try to explain what I'm doing and what I would like to do.
I am building a template that will be used as a stand-alone for individual projects. From a userform checklist, the user selects up to 17 categories. The available categories never change but the number of categories applicable to any given project vary. However, the applicable categories do not change within the scope of the project. On another tab is a list of 50-60 items that are assigned to these 17 categories. Once the project categories are chosen, the script sorts/filters that list and exports the results to another tab. What I have works like a charm. The challenge is this: while the categories will never change, it is possible that the categorization of the 50-60 items will. If we revise the categorization, I need a new sorted/filtered list to overwrite the old one. I've got that part figured out. What I want to know, can the array generated when the original categories are selected be stored and accessed if/when a revision is required?
Here is the script that generates my array:
The array myList() is then fed to a filter command. I would like to store myList() as an array that I can access without having to go through the "select categories" process. I have no problem with (and actually it would be preferable) the stored array changing if I restarted the original process.
Thanks in advance!
I am building a template that will be used as a stand-alone for individual projects. From a userform checklist, the user selects up to 17 categories. The available categories never change but the number of categories applicable to any given project vary. However, the applicable categories do not change within the scope of the project. On another tab is a list of 50-60 items that are assigned to these 17 categories. Once the project categories are chosen, the script sorts/filters that list and exports the results to another tab. What I have works like a charm. The challenge is this: while the categories will never change, it is possible that the categorization of the 50-60 items will. If we revise the categorization, I need a new sorted/filtered list to overwrite the old one. I've got that part figured out. What I want to know, can the array generated when the original categories are selected be stored and accessed if/when a revision is required?
Here is the script that generates my array:
Code:
For Each ctrl In Me.Controls[INDENT]Debug.Print TypeName(ctrl)[/INDENT]
If TypeOf ctrl Is msforms.CheckBox Then
If ctrl.Value = True Then
i = i + 1
ReDim Preserve myList(1 To i)
myList(i) = ctrl.Caption
End If
End If
Next ctrl
The array myList() is then fed to a filter command. I would like to store myList() as an array that I can access without having to go through the "select categories" process. I have no problem with (and actually it would be preferable) the stored array changing if I restarted the original process.
Thanks in advance!