+ Reply to Thread
Results 1 to 2 of 2

Using VBA toggle button for multiple task

  1. #1
    Registered User
    Join Date
    03-01-2013
    Location
    NYC
    MS-Off Ver
    Excel 2013
    Posts
    19

    Using VBA toggle button for multiple task

    Hi,
    I created a toggle button to show or hide text:

    Private Sub ToggleButton1_Click()

    If ToggleButton1.Value = True Then
    'This area contains the things you want to happen
    'when the toggle button is not depressed
    Range("b7:d8").Font.Color = RGB(0, 0, 0)


    Else
    'This area contains the things you want to happen
    'when the toggle button is depressed
    Range("b7:d8").Font.Color = RGB(252, 228, 214)
    End If
    End Sub

    It's maybe not the best way to make text invisible, but I would like to add another task: toggling between =SUM(B3:B26)-B7-B8 in cell B27 & =SUM(B3:B26)

    Can I do it?
    Thanks,
    dbuff

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Using VBA toggle button for multiple task

    Hi dbuff,
    Unfortunately,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1