Dan Wilson
Well-known Member
- Joined
- Feb 5, 2006
- Messages
- 546
- Office Version
- 365
- Platform
- Windows
Good day. I have a Macro that is working, but it needs one more step that I don't know how to do. The Macro below prints out either "Done" or "Failed" upon completion. When it prints out one of those words, the word is enclosed in a box labeled Microsoft Excel and it requires that I either select the "OK" button or hit the Return key to close it and move on. Is there a way to print out the words without having to follow up with another action? I appreciate any help with this.
Thank you,
Dan Wilson...
VBA Code:
Sub Copy_Random_Numbers()
' 12/8/2024
' Copy_Random_Numbers Macro
' Copy random numbers and check for bad
'
Application.ScreenUpdating = falsemsg = "Sorry - failed"
For try = 1 To 3000
'
Range("a4:an4") = Range("a3:an3").Value
If Range("R14") = 0 Then
msg = "Done"
GoTo done
End If
Next try
Range("a6").Select
msg = "Failed"
'
done:
Application.ScreenUpdating = True
MsgBox msg
'
End Sub
Thank you,
Dan Wilson...
Last edited by a moderator: