Hide Unhide Button

  • Thread starter Microsoft Communities
  • Start date
M

Microsoft Communities

This is a two fold question:
Q1

I have a situation where a button resides in 2 of 4 columns that hidden
until needed.
When I hide the columns it appears that the button is sized where when I
unhide the columns the button does not show.
Is there a way in a macro that I can size and place the button where I want
it.
Example the button is called "Reset" and it calls a reset macro. It reside
in columns H and J, Columns G through L are hidden until needed. The button
takes up the cells H20 through J21.

Q2
I would like to be able to Hide or Unhide a button using the Text Label Not
the button number.

Thanks for your help
 
D

Dave Peterson

I'm not sure which button you used.

Was it a button from the Forms Toolbar?

Or was it a commandbutton from the control toolbox toolbar?

In either case, you can rightclick on the button/commandbutton and choose Format
Control. Then on the properties tab, you can check the "Move and size with
cells".

Then when you hide/show columns or rows, the buttons/commandbuttons should hide
and show ok.

======
As for the other macro question, I'm kind of confused.

If the reset macro only shows the (hidden) columns, then changing the properties
should be sufficient.

Or if the reset macro actually shows the button/commandbutton (if it's hidden,
but the column is visible)--but only those buttons/commandbuttons that have a
certain caption.

Do each have their own unique caption or do they share captions?

If the range that holds the buttons/commandbuttons is fixed, then you could also
check the location before doing anything to each button/commandbutton.

The code for the buttons from the Forms toolbar would be different from the code
for the commandbuttons from the Control toolbox toolbar.
 
D

Don Guillett

Very doable but depends on your version of xl___________? and what type
button you are using_________?
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.
 
M

Microsoft Communities

Sorry for the confusion.
The button was created using the insert text box. It calls a macro that
clears data from many cells.
When I go to the properties it does not have a move and size option.

The other macro question relates to another macro that is run. That macro
should show another button or textbox not the one in question above.
This button I want to show or hide is on several sheets but each button (or
textbox has the same caption but not textbox number.
 
D

Dave Peterson

That's a pretty unusual choice to use a textbox as a button. If you really used
a textbox from the Drawing toolbar, then rightclick on it and you'll see an
option for "format textbox". That has a tab where you can set the "move and
size with cells" property.

You really have to get to the specifics for the macro portion.

Are you hiding/showing buttons/commandbuttons or textboxes (from the drawing
toolbar or from the control toolbox toolbar)?

Along with the other questions from before...
 

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