Still trying to learn how to explain what I need in a simple thread title, but here's my issue:
I have code written that "works", but it's taking quite a while for my file to open and run through the "initialize" event code.
The code does the following:
1. Turns off screen updating
2. Opens another source workbook from a network folder
3. Copies 8 columns worth of data (about 6,000 rows, give or take) to Sheet4 on my workbook
4. Closes the source workbook
5. Renames and sets cell formatting on the 8 column headers (row 1, columns A:H)
6. Applies an autofilter and filters the copied data based on column A
7. Creates a list of unique values from each of 6 columns from Sheet4 on column A of 6 separate sheets, each containing a named dynamic range in column A.
8. Sets focus on Sheet1 and turns on screen updating
Sheet1 contains a userform which, upon opening, uses the 6 sheets of unique data to load the lists for 6 comboboxes. The comboboxes work in a reverse cascading fashion, where filling in the first will fill the remaining ones with the data that relates to the value entered in the first combobox, and if "n/a" is entered, then the focus moves to the next combobox in line and so on until either a job is selected or all boxes are filled with "n/a". I'm actually quite proud of the combobox functionality, as it's working exactly as I intended it to.
My issue is that it's taking a LONG time for the workbook to open and initialize, presumably because I copied and modified the same section of code 6 times to perform operation "7" above... I couldn't figure out a better way of getting the combobox lists loaded with only the unique data and no repeats.
I have attached my file in its' current state, with the portion of code that opens and references the second file neutered with (') marks... the data is already loaded, other than that the sample file should run the same for you as it does for me.
The code I have so far is below, please take a look and see if there's a better, more efficient way of getting to the end result I have here. Thanks a bunch!
![]()
Please Login or Register to view this content.
Bookmarks