+ Reply to Thread
Results 1 to 2 of 2

i have a sub that starts with loading a userform then does some more code after.... but

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-27-2015
    Location
    New hampshire
    MS-Off Ver
    excel 2013
    Posts
    143

    i have a sub that starts with loading a userform then does some more code after.... but

    I have a button in my worksheet that when its pressed it first loads a userform then after userform is filled out it does some more code but I want it so that if I click the red X at the top of the userform it dosnt finish the rest of the code... how could this be done?.... heres the code for the button in my worksheet



    Sub New_Tool_study()
    
    UserForm2.Show
    
    Sheets("Tool Data").Visible = True
    Sheets("Tool Data").Select
     Rows("3:3784").Select
        Selection.ClearContents
        With Selection.Interior
            .Pattern = xlNone
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
         Range("A3").Select
        Sheets("Tool Data").Visible = True
       
        Sheets("Enter").Select
     
    End Sub

  2. #2
    Forum Contributor
    Join Date
    01-27-2015
    Location
    New hampshire
    MS-Off Ver
    excel 2013
    Posts
    143

    Cancel main sub if red x is clicked in userform

    I have a button in my worksheet that when its pressed it first loads a userform then after userform is filled out it does some more code but I want it so that if I click the red X at the top of the userform it dosnt finish the rest of the code... how could this be done?.... heres the code for the button in my worksheet
    
    
      
    Sub New_Tool_study()
    
    UserForm2.Show
    
    Sheets("Tool Data").Visible = True
    Sheets("Tool Data").Select
     Rows("3:3784").Select
        Selection.ClearContents
        With Selection.Interior
            .Pattern = xlNone
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
         Range("A3").Select
        Sheets("Tool Data").Visible = True
       
        Sheets("Enter").Select
     
    End Sub

+ 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] Userform Keeps loading after code is completed
    By lday75 in forum Excel General
    Replies: 1
    Last Post: 07-14-2012, 02:46 AM
  2. Loading userform
    By tian0020 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2007, 01:57 AM
  3. Loading a Userform
    By Jason Zischke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2006, 04:40 AM
  4. Loading Userform
    By Steven Cheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-09-2005, 03:20 PM
  5. Showing Userform, while Excel starts as Minimized!
    By t4fast in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2005, 10:09 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