• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

Hiding a command button

I have many command buttons whose Visible property is set to False. However, I have 1 particular command button whose Visible property is set to False yet it remains visible?
I have a command button related to the first command button with the following code:
Private Sub MultipleIf_Click()
   Home57.Visible = False
   Sheets("Multiple Ifs").Activate
   Sheets("Multiple Ifs").MultipleIfs.Select
End Sub

Open in new window

The object remains visible?

The location of the first command button is A57 and C57 for the second. File attached - s/b Function and Formulas for Excel Revised3.xlsm. If not please advise
Frank Freese
Frank Freese
  • 3
  • 2
1 Solution
Martin LissOlder than dirtCommented:
You have two buttons in the same place. If you drag Home57 a bit to the right you'll see Home14A behind it and it's that button that is remaining visible when Home57 is hidden.
Frank FreeseAuthor Commented:
I thought I had all those identfied but missed one.
By the way, you taught me quite a bit here and thinking I would need more help on the Main tab I think I figured out the next step I want to do. You've been awesome here and again, many thanks
Frank FreeseAuthor Commented:
Simply fantastic
Martin LissOlder than dirtCommented:
You're welcome and once again I'm glad I was able to help. BTW I found out what was wrong by putting a breakpoint on the line that hides Home57 and then checked its visibility, and when VBA said it was hidden I knew there were only two possibilities. One, that there was more than one control by the same name (the other one would have to be on a different sheet) and two, that there were two controls in the same place.

Select the 'About Me' tab in my profile and you'll find an article on debugging among the other articles I've written. Ignore the fact that it cites VB6 since most of it applies to VBA.
Marty - MVP 2009 to 2013
Frank FreeseAuthor Commented:
I've already check the About Me and saw the Spell Check a Textbox link.
It is also good to see some at my age bracket activity involved in helping others.
I'm sure I'll be back
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now