Excel VBA code question regarding Message Box

PGD15

Board Regular
Joined
Aug 5, 2016
Messages
137
Hi,

I've got a question regarding VBA coding and the message box functions.

currently I've got a string of information (where the goal is not to have a message, all messages displayed are error messages). However if my string is empty/blank (so no errors) is there a way to say "no error found" in the same msb box

so in simple effectively if the message box string is empty/blank up to this point add to the string "No errors found"?

currently i have a second message box pop up saying that.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Code:
[/COLOR]Sub Macro17()
'
' Macro17 Macro
'




If ActiveCell.Value <> "Good" Then MsgBox "bad news"


If ActiveCell.Value = "Good" Then Macro19


End Sub




Sub Macro19()
MsgBox "good news"
End Sub

This might help, if the cell says Good (no errors) it does one thing if it says nasty stuff (errors everywhere!) it jumps to another macro to show a different box
 
Upvote 0
Hi GJSBED,

Thanks for the reply, unfortunately this doesn't help me. Its not essential i get this working but it just looks nicer for my end user. Thanks anyway :)
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,678
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top