+ Reply to Thread
Results 1 to 6 of 6

Peculiar behavior — button on userform

Hybrid View

  1. #1
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,487

    Re: Peculiar behavior — button on userform

    I would imagine it should be something like ...

    Option Explicit
    
    Sub Hide_Window()
    
        Application.Visible = False
        ToggleShow_Hide.Value = True
    
    End Sub
    
    Sub Show_Window()
    
        Application.Visible = True
        ToggleShow_Hide.Value = False
    
    End Sub
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  2. #2
    Registered User
    Join Date
    11-16-2011
    Location
    Vermont
    MS-Off Ver
    Excel 365
    Posts
    57

    Re: Peculiar behavior — button on userform

    Thank you again, Trevor

    I tried inserting those toggle values in the Show and Hide macros, as you suggested. Then it wanted me to define "ToggleShow_Hide" so I defined it as "ToggleButton" (seemed logical). Like this:
    Option Explicit
    Dim ToggleShow_Hide As ToggleButton
    
    Sub Hide_Window()
    
        Application.Visible = False
        ToggleShow_Hide.Value = True
    
    End Sub
    
    Sub Show_Window()
    
        Application.Visible = True
        ToggleShow_Hide.Value = False
        
    End Sub
    —but then it froze up on ToggleShow_Hide.Value, with the following message:
    Attachment 663403. I'm so confused....Am I defining it wrong? Do I need another line to my definitions?
    Nick

    (I'm only an egg)

+ 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] Numbered list button behavior
    By Jacc in forum Word Formatting & General
    Replies: 3
    Last Post: 02-24-2017, 08:59 AM
  2. [SOLVED] Behavior of Buttons in userform
    By tommymc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-07-2012, 10:19 AM
  3. Different behavior if I close userform via button or x
    By nohero in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-05-2011, 04:04 PM
  4. Need macro's behavior to depend on button pushed
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2010, 11:46 AM
  5. Inconsistant Behavior using a UserForm
    By vivictis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2008, 03:50 PM
  6. Userform strange behavior
    By Shaun_email in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-09-2007, 07:47 PM
  7. Odd UserForm Behavior
    By Gene in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-03-2006, 11:15 PM

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