Branching in a macro

  • Thread starter Thread starter BillShut
  • Start date Start date
B

BillShut

I want an msgbox, to accept a default of username choose yes. If yes
it will go to a point in the macro and continue.

If no, it will ask for input or a second default of "Comment" and then
continue to the same point in the macro.

How do I get it to branch?

Or even better, can I get it to choose 1 - being Username, 2 - being
"Comment" 3 - being input all in the same input box / message box?

Thanks very much,

Bill
 
You should be careful with that name.

In essence, you don't.

ans = MsgBox("Question", vbYesNo)
If ans = vbYes Then
inp = InputBox("Comment")
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top