Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7990959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:09:22+00:00 2026-06-04T13:09:22+00:00

I got 3 different form buttons on my spreadsheet. I want to disable 2

  • 0

I got 3 different form buttons on my spreadsheet. I want to disable 2 of them while one is pressed. Is that possible?

In C# the button can be true or false, but I can’t find any examples of this in VBA Excel 2010?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:09:23+00:00Added an answer on June 4, 2026 at 1:09 pm

    You cannot disable Form Buttons. If you want to use that functionality then use the ActiveX button.

    However there is an alternative. Create 2 Public Boolean Variables and then in the click event of Button 1 Set the variables to True or False. Depending on the Boolean variables, the other 2 buttons will run their code or not. For example

    Option Explicit
    
    Dim enableB2 As Boolean, enableB3 As Boolean
    
    Sub Button1_Click()
        If enableB2 = False Then
            enableB2 = True: enableB3 = True
        Else
            enableB2 = False: enableB3 = False
        End If
    
        '
        '~~> Rest of the code
        '
    End Sub
    
    Sub Button2_Click()
         If enableB2 = True Then
            '
            MsgBox "Hello You clicked Button 2"
            '
         End If
    End Sub
    
    Sub Button3_Click()
         If enableB3 = True Then
            '
            MsgBox "Hello You clicked Button 3"
            '
         End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got 3 files that every one of them is in different folders.. A.php
my form has got two buttons ... both for entirely different purpose.. so there
I've one MainForm window and from that user can press 3 buttons. Each of
I got a solution that includes 3 different projects, a Class Library, a Web
In a different post I got a reply that tells about Repetitive SQL. Could
I have a swing application that includes radio buttons on a form. I have
I got a form, which has 2 buttons, 1 is to set the input
I've got a form with some radio buttons in it. When a link is
I've got a data form I developed under Snow Leopard, that has NSTextField boxes
I have a user control on a form that can spawn several non-modal child

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.