Pause VBA while changing form

bstice

Registered User.
Local time
Yesterday, 20:14
Joined
Jul 16, 2008
Messages
55
Good Morning all,

I have a combo box which populates data in a form which in turn populates fields in an excel sheet via excel automation. After I finish populating the first round of data in Excel from the form, I would like the VBA to pause or stop while I change the combo box so diffferent information is in the form. Then I would like to restart the code so that data is populated in excel.

I know how to do this with two separate procedures, but I would like to tie them together. I just need to know how to pause the code, change the combo and restart the code. Thanks and if I can I award reputation points for help. Thanks

Brennan
 
You should create a sub routine to feed the new data into the two process.

Code:
'the long way (not recommended).

Private Sub DoThis()

    cboDataOne = "Data1"
    Call Process1
    Call Process2

    cboDataOne = "Data2"
    Call Process1
    Call Process2

    cboDataOne = "Data3"
    Call Process1
    Call Process2


End Sub

or you can loop through the combobox and then call your two processes. If you only need certain records from that combobox, you will need to set it up so you can select certain item and process them that way.
 

Users who are viewing this thread

Back
Top Bottom