ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Declare variable as what? (https://www.excelbanter.com/excel-programming/314973-declare-variable-what.html)

N E Body

Declare variable as what?
 
Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny



Myrna Larson

Declare variable as what?
 
Long. vbYes and vbNo are long integer constants.

On Wed, 27 Oct 2004 23:20:36 +0100, "N E Body"
wrote:

Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny



Bob Phillips[_6_]

Declare variable as what?
 
as Long

--

HTH

RP

"N E Body" wrote in message
...
Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny





Trevor Shuttleworth

Declare variable as what?
 
Kenny

Dim Ans As Integer

Regards

Trevor


"N E Body" wrote in message
...
Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny





N E Body

Declare variable as what?
 
TNX Myrna


"Myrna Larson" wrote in message
...
Long. vbYes and vbNo are long integer constants.

On Wed, 27 Oct 2004 23:20:36 +0100, "N E Body"


wrote:

Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny





RB Smissaert

Declare variable as what?
 
Also you can do it like this, without declaring a variable:

If MsgBox("If boxes are empty you will wipe out the list - continue?", _
vbYesNo, "Caution") = vbNo Then
Exit Sub
End If

RBS


"N E Body" wrote in message
...
Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny




Rob Bovey

Declare variable as what?
 

You can also declare it as VbMsgBoxResult and it will give you an
auto-complete list of allowable values when you press the equals sign.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"N E Body" wrote in message
...
Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny






All times are GMT +1. The time now is 12:57 PM.

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