Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Make macro toggle? (Office 2000)

    Hi,
    I have a macro in "personal" that changes "view zero values" to off as indicated below:

    Sub Zero_Values()
    '
    ' Zero_Values Macro
    ' Macro recorded 7/25/2007 by Louise
    '
    ActiveWindow.DisplayZeros = False
    End Sub

    I have assigned this macro to a toolbar button. Is there any way I can change this to a toggle button? In other words, when toolbar button is depressed, the zeros are not seen, when the button is "out" or toggled again, you can see the zeros.

    Any ideas?

    Thank you
    Louise

  2. #2
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make macro toggle? (Office 2000)

    Try ActiveWindow.DisplayZeros = Not ActiveWindow.DisplayZeros
    Regards
    Don

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Make macro toggle? (Office 2000)

    To make the button be "up" or "down" would be rather complicated, because you'd have to keep track of the state of the DisplayZeros setting as the user switches between windows. But to make the button toggle the setting is easy:

    Sub Zero_Values()
    '
    ' Zero_Values Macro
    ' Macro recorded 7/25/2007 by Louise
    '
    ActiveWindow.DisplayZeros = Not ActiveWindow.DisplayZeros
    End Sub

  4. #4
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Make macro toggle? (Office 2000)

    Hi Hans and Don,

    Thank you very much! I hope someday I'll know about an eighth of what you know. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>
    Louise

Posting Permissions

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