ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What does "resp" mean? (https://www.excelbanter.com/excel-discussion-misc-queries/148679-what-does-resp-mean.html)

Elise148

What does "resp" mean?
 
In the section of a macro below, what does "resp" mean?

resp = MsgBox("Do you want to run the macro?", vbYesNo, Confirm)
If resp = vbNo Then
MsgBox ("Macro stopped.")



Toppers

What does "resp" mean?
 
"Resp" is just a variable which holds the value of the YES/NO button(s) when
they are pressed. (I suspect "resp" is used as a shorthand for response)

It could equally well have been called "X" or "Y" or "answer".

VbNo is the (special) VBA variable which holds the value associated with the
NO button: vbYES is the equivlent for the YES button.

HTH

"Elise148" wrote:

In the section of a macro below, what does "resp" mean?

resp = MsgBox("Do you want to run the macro?", vbYesNo, Confirm)
If resp = vbNo Then
MsgBox ("Macro stopped.")



Elise148

What does "resp" mean?
 
Thanks. I like VBA, and I want to understand as much of it as I can.

"Toppers" wrote:

"Resp" is just a variable which holds the value of the YES/NO button(s) when
they are pressed. (I suspect "resp" is used as a shorthand for response)

It could equally well have been called "X" or "Y" or "answer".

VbNo is the (special) VBA variable which holds the value associated with the
NO button: vbYES is the equivlent for the YES button.

HTH

"Elise148" wrote:

In the section of a macro below, what does "resp" mean?

resp = MsgBox("Do you want to run the macro?", vbYesNo, Confirm)
If resp = vbNo Then
MsgBox ("Macro stopped.")




All times are GMT +1. The time now is 08:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com