View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don M. Don M. is offline
external usenet poster
 
Posts: 51
Default Can the Text on a button form be referenced from a cell?

Yes, there are nine cells who's text change according to the data imported. I
would like one of 9 different buttons to reference one of these nine cells.

A1 = TWE
B1 = TMW
C1 = TNE
D1 = TMA
E1 = TSE
F1 = TSC
G1 = TGL
H1 = TCE
I1 = TNC

Then the Button 1 says "Print TWE" and runs a macro assigned to it. It will
always run that macro, regardless of what the text is. The Button 2 then says
"Print TMW", etc .....

The next time I use the spread sheet the data in those nine cells will be
different text, and the buttons need to correlate to that text and will still
run the same macros that are assigned to them.

The only thing that changes is the text on the buttons.

As for where the buttons came from, I used the Forms toolbar and drew the
button out with the curser. But, I can use a different button if I have to to
make this work.

Don

"Rick (MVP - Excel)" wrote:

You mention having "generic buttons"... plural... are you asking for this
functionality on a single button? That is, is A1 associated with only one of
the several buttons you have and, as such, only that button's caption will
be changed as A1 changes? Also, where did you get the button from... the
Form's Toolbar or the Control Toolbox's Toolbar?

"Joel" wrote:

the problem is if you have more than one button on a worksheet. Excel will
not know which button is associated with each cell unless you have a table in
excel indicating the button Name and the cell on the worksheet.