Glitch5618
Board Regular
- Joined
- Nov 6, 2015
- Messages
- 105
Using excel 2007.
I've been banging my head against the wall on this one for awhile now. I'm rather new to VBA so forgive me if this is a simple matter.
Basically I have a program that filters data, and based on the filters applied you click a button aptly named Get Data. This program has over 1600 lines of code so far so I have split up the code and placed it in standard modules based on its function, grouping similar code together.
In order to reference the code on the main user form from any given module I use code like this...
So if I wanted to reference a combo box located on the user form I just use "f.combobox.value" within the module code, this has been working for me no problem.
What I'm trying to do now is when you click the Get Data button it shows another user form that contains a multi-column list box with the information. So the idea is on the main user form I run a sub that shows the "DataBox" user-form and then calls a subroutine contained within a module. That modules code searchs the data based on a selected filter from the main user-form and then loads that data to an array which I then assign to the list-box contained within the "DataBox" userform. I figured this would be a simple matter of just adding another letter to designate which userform it was referencing, such as...
However if I place this in any module and try to compile the code I get the error mentioned in the title. When I try to debug it just highlights the subroutine of the main user-form that is calling the module sub. What am I missing here?
I've been banging my head against the wall on this one for awhile now. I'm rather new to VBA so forgive me if this is a simple matter.
Basically I have a program that filters data, and based on the filters applied you click a button aptly named Get Data. This program has over 1600 lines of code so far so I have split up the code and placed it in standard modules based on its function, grouping similar code together.
In order to reference the code on the main user form from any given module I use code like this...
Code:
Sub RandomSub(f As UserForm)
What I'm trying to do now is when you click the Get Data button it shows another user form that contains a multi-column list box with the information. So the idea is on the main user form I run a sub that shows the "DataBox" user-form and then calls a subroutine contained within a module. That modules code searchs the data based on a selected filter from the main user-form and then loads that data to an array which I then assign to the list-box contained within the "DataBox" userform. I figured this would be a simple matter of just adding another letter to designate which userform it was referencing, such as...
Code:
Sub RandomSub(f As UserForm, D as DataBox)
Last edited: