how to use a command button in excel?

G

GailK

What button type [listbox or command?] and what script do I attach to a
button I've called 'Select a Workgroup' which, when clicked on, will provide
a drop down box with all workgroup names. I would like to be able to click
on a name and have the data within the report reflect that of the workgroup
selected. I'm trying to recreate a macro button in Excel as used in Lotus -
example below :

Sub Click(Source As Buttoncontrol)
[/w].MacroRun
End Sub

*where /w represents "workgroup"

Does Excel have the same premise as Lotus whereby a "workgrouplist" and
"workgrouppick" need to be named in a range as well as the following
formula{CHOOSE-ITEM workgrouplist;workgrouppick;"Select a
Workgroup";"Workgroup Selection"}{calc}. Is there a web site that I can
refer to for assistance?
Thank you!
 
O

Otto Moehrbach

Gail
I'm not sure I follow everything you said. I get the idea that you want
to have a list presented (displayed) to the user for the purpose of having
the user select (click on) one item from the list. Then you want Excel to
automatically transfer/copy/bring some data, that is pertinent to the
selection, from a source location to some other destination location. Is
that right?
Assuming the above is correct, you can do this with Data Validation and
a number of VLookup formulas. Maybe. The "Maybe" is dependent on what your
data layout is. If VLookup formulas won't do it, VBA will.
You would use Data Validation (look it up in Help) in one cell. When
the user selects that cell and clicks on the down-arrow to the right of that
cell, a drop-down list of all the workgroup names would be displayed. When
the user clicks on one of the names, that name would be displayed in that
cell. Everything else would then be done automatically.
I assume that you have the data you want copied located in a table
structure with the workgroup names in the first column of this table. If
this is so, you can place VLookup formulas in each of the destination cells.
That way, each such formula cell will display the specific data from the
table that is pertinent to the selection made.
Please post back if this sounds like it might work for you. Provide
more details about what you have and what you want to happen. HTH Otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top