Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed a form or excel sheet in workbook 1

Status
Not open for further replies.

jessedh

MIS
Apr 16, 2002
96
US
Hi,

I need to create either a form or an excel worksheet that I can put in cell j2 of every worksheet in a workbook I have.

The form has to have 4 options (prefer to be check boxes) of active, 1099, terminated, or inactive.

Based on which is checked, i want to have a macro parse through the workbook and print conditionally.

Once I can embed the object I think that I can do the rest...

Any help?

Can I make a form in excel?

Thanks!
Jesse
 
I'm not positive I understand what you are asking, but what about floating a combo-box over cell J2 on each sheet? Put your four options in the box, and use the Click event to call a module with your processing code (with testing code to see which option was chosen).

VBAjedi [swords]
 
I would not recommend using the Click event to cause printing to start. The Click event fires as the user scrolls up and down the list (with the keyboard).

The simplest approach would be to use Data Validation in cell J2 to restrict the choice to one of the four values, then use a Command Button to initiate print. The macro can then process according to the contents of J2.

The use of check boxes implies that more than one can be checked at the same time. From the list of choices it sounds like that is not what is intended. Combo boxes and Radio Buttons (Excel calls them option buttons) are the objects that allow the user a single choice among a finite list.

 
That would be a lot of coding for a relatively simple request, when you can replicate what you want more or less using Excel functionality.

Put your four values into separate cells in your worksheet. Select the range for which you want a set of options to appear (J2 by teh sound of it), then select Data > Validation. Select the "List" option then select your range.

If you have a lot of sheets for which to do this you may want to use VBA to replicate it - try using teh macro recorder to get a feel for the code produced.

 
Thanks for everyone's help.

What I ended up doing was using the List box option and having it dump the data into the infamous "J2".

Since I only want the sheets printed when the user does, not on any event, I coded a macro.

For each ws in Worksheets
If range("j2").value = 2
etc......

Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top