Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Undo button

  1. #11
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Chers guys you have underlined mt teaching.. no go best what you do on the way in reverse on the way out.

    the tips are all bar the same, we are working the same way..

    Cheers guys..

    Nice code ill give it a play dk

    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  2. #12
    New Member
    Join Date
    Aug 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Undo button

    Hi guys,
    this actually is quite an old topic, I know... just found this through the search function however, and was wondering whether any of you could help me with an issue Im facing at the moment.
    What Im trying to do is using application.OnUndo in case the "If"-value is not true... i.e. ticking the box means showing text in a cell and unticking it would trigger reverse action (deleting the previous step and the text)

    my problem is that the way Ive put it together so far doesnt really lead to a success even though it looks good to me
    This is what Ive got so far:

    Code:
    Private Sub CheckBox2_Click()
    
        Dim x As String
        Dim x As String
        
            x = "AB"
            y = "A02"
            
            If 
    ***.CheckBox2 = True Then
                ***.Range("A6") = y
                ***.Range("d6") = x
                
            ElseIf ***.CheckBox2 = False Then
                MsgBox "deleted"
                Application.OnUndo "Undo CheckBox2", "UndoCheckBox2"
    End If
                
    End Sub
    
    Sub UndoCheckBox2()
    ***.Range("A6").ClearContents
    ***.Range("d6").ClearContents
    
    End Sub
    Would be happy about any comments or help
    thanks!

  3. #13
    New Member
    Join Date
    Aug 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Undo button

    Quote Originally Posted by MisterLamp View Post
    Hi guys,
    this actually is quite an old topic, I know... just found this through the search function however, and was wondering whether any of you could help me with an issue Im facing at the moment.
    What Im trying to do is using application.OnUndo in case the "If"-value is not true... i.e. ticking the box means showing text in a cell and unticking it would trigger reverse action (deleting the previous step and the text)

    my problem is that the way Ive put it together so far doesnt really lead to a success even though it looks good to me
    This is what Ive got so far:

    Code:
    Private Sub CheckBox2_Click()
    
        Dim x As String
        Dim x As String
        
            x = "AB"
            y = "A02"
            
            If 
    ***.CheckBox2 = True Then
                ***.Range("A6") = y
                ***.Range("d6") = x
                
            ElseIf ***.CheckBox2 = False Then
                MsgBox "deleted"
                Application.OnUndo "Undo CheckBox2", "UndoCheckBox2"
    End If
                
    End Sub
    
    Sub UndoCheckBox2()
    ***.Range("A6").ClearContents
    ***.Range("d6").ClearContents
    
    End Sub
    Would be happy about any comments or help
    thanks!
    sorry it should read
    Dim x As String
    Dim y As String

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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