Results 1 to 7 of 7

Msg box response is ignored

Threaded View

  1. #1
    Registered User
    Join Date
    04-26-2009
    Location
    Norfolk
    MS-Off Ver
    Excel 2003
    Posts
    9

    Msg box response is ignored

    Hello,

    I am trying to achieve a response from a msgbox which will either continue with the sub or exit. I think my code is right but it doesn't seem to work and just carrys on regardless. Any help would be appreciated.

    Private Sub CommandButton1_Click()
    
    Dim MSG1 As Integer
    
    MSG1 = MsgBox("Send Scaffold to destruct?", vbCritical)
    
    If MSG1 = vbCancel Then
    
    Exit Sub
    
    Else
     
    Worksheets("sheet2").Activate
    
    ActiveSheet.Range("b4").Select
    
    Do
    
    If IsEmpty(ActiveCell) = False Then
    
        ActiveCell.Offset(1, 0).Select
       
    End If
    
    Loop Until IsEmpty(ActiveCell) = True
        
        
        
        Worksheets("sheet1").Range("A4:h4").Copy
        
        Worksheets("sheet2").Paste Destination:=ActiveCell.Offset(0, -1)
              
        Worksheets("sheet1").Activate
        
        Worksheets("Sheet1").Rows(4).Delete
    
    End If
       
    End Sub
    Last edited by aaron.ronnie; 04-29-2009 at 05:37 AM.

Thread Information

Users Browsing this Thread

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

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