+ Reply to Thread
Results 1 to 4 of 4

Toggle button caption to return sum value for certain cells

  1. #1
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Toggle button caption to return sum value for certain cells

    Hello , any help will be appreciated
    i have a toggle button to hide four columns and it is working just fine .
    i Have the caption on that button to return the sum of four cells , the sum is showing the number without a $sign.
    what should i add to have the return number formatted with $ sign .


    Thank you

    Private Sub ToggleButton1_Click()
    xAddress = "H:H, Q:Q, Z:Z, AI:AI"
    If ToggleButton1.Value Then
    Application.ActiveSheet.Range(xAddress).EntireColumn.Hidden = True
    ToggleButton1.Caption = " "
    Else
    Application.ActiveSheet.Range(xAddress).EntireColumn.Hidden = False
    ToggleButton1.Caption = Sheet33.Range("H37") + Range("Q37") + Range("Z37") + Range("AI37").Value
    End If
    End Sub
    Last edited by Fatekb; 02-03-2023 at 08:41 AM.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Toggle button caption to return sum value for certain cells

    Hi there,

    Take a look at the attached workbook and see if it does what you need. It uses the following code:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Re: Toggle button caption to return sum value for certain cells

    Most Excellent, it worked like a charm.
    thank you.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Toggle button caption to return sum value for certain cells

    Hi again,

    Many thanks for your very prompt feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] User From Toggle Button Caption Issues
    By brentjohn in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-03-2019, 11:24 AM
  2. Macro to change caption in Toggle button (Open/Close) code - Any Suggetions?
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 04-26-2016, 09:01 AM
  3. Replies: 1
    Last Post: 04-23-2016, 04:34 PM
  4. userform toggle button, 3 selection options? True, False and caption.
    By nvandyken in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2015, 02:08 PM
  5. Toggle change control button face id & caption
    By jpexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2009, 08:05 AM
  6. Toggle change control button face id & caption
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2005, 10:05 PM
  7. Replies: 2
    Last Post: 05-12-2005, 12:07 AM

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