View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Using vbYes or If statement

If MsgBox("Select Yes or No", vbYesNo) = vbYes Then
MsgBox "You selected yes."
Else
MsgBox "You selected no."
End If

"Lav" wrote:

I have 3 macros:

One I send as a test to me, one to two of us and the third one to
others.

The code is all the same in the 3 macros apart from one line.

However if I change code in one I have to change it in all three.

Rather than hard coding bu having those 3 lines in the one macro and
silencing two of them, how do I do use an If statement or vbYes or
choose function to select the line of code I would like?

Thanks