Hi
I have a code, which works, but I want msgbox appear after the code executes. But it does not. Why?
Private Sub CommandButton7_Click() 'Code is not working
Dim intIndex As Integer, intCount As Integer, i As Integer, ListRow As Integer
Application.ScreenUpdating = False
On Error GoTo oops
For intIndex = 0 To ListBox1.ListCount - 1 'Counts how many items in listbox.1 selected
If ListBox1.Selected(intIndex) Then intCount = intCount + 1
Next intIndex
For ListRow = 1 To 40 'Hides corresponding buttons
If ListBox1.Selected(ListRow) Then
ActiveSheet.Shapes(Application.WorksheetFunction.Index(Range("ButtonName"), _
Application.WorksheetFunction.Match(ListBox1.List(ListRow), _
ActiveSheet.Range("Source"), 0))).Visible = False
End If
Next ListRow
MsgBox "DONE!!!!!!!!!!!!!" 'HERE HERE HERE NOT APPEARING
oops:
Unload Me
End Sub
Bookmarks