Running Code within a Form

Papa_Don

New Member
Joined
Jan 22, 2015
Messages
38
Group,

I'm working in Macro that I didn't write. This Macro was written to do run its commands one selection at a time (the selections are made via a drop-down box). I need to modify this to loop these selections so that all will run automatically one after another.

It's easy to read the sequence of events that take place during the run of the routine. However there are a couple of forms the writer created that have "OK" buttons to fire off the next part of the sequence. I need to write the code to use this and, in essence, "click" the "OK" button via the code. However calling that doesn't seem to be the correct way to do this. I've tried
Code:
frmFileFilter.cmdOK
to call it. "frmFileFilter" is the name of the form and "cmdOK" is the name of the button. I sure my syntax is incorrect but I can't seem to find what will fire this off. Would any of you know how to do this?

In advance, thanks for your help and wisdom!

Papa Don
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,

What is the form used for? Is it used to collect information?? If its not needed it would be easier to just not show the form.
 
Upvote 0
CMAnslow, the form has some initialization behind it that looks important. Thus is am opening the form. I did try
Code:
Application.Run [COLOR=#333333]frmFileFilter.cmdOK[/COLOR]
that seems to let it run. But further into the sequence it errors out for other reasons. When I have time I may post that if I can't get past it.

Thanks for your input.

Don
 
Upvote 0

Forum statistics

Threads
1,215,949
Messages
6,127,877
Members
449,410
Latest member
adunn_23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top