Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default 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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Declare Variable zapatista66[_12_] Excel Programming 2 October 7th 04 04:55 PM
Declare Variable zapatista66[_13_] Excel Programming 0 October 7th 04 04:13 PM
Declare Variable zapatista66[_11_] Excel Programming 1 October 7th 04 03:23 PM
Declare Variable zapatista66[_10_] Excel Programming 0 October 6th 04 09:02 PM
Declare Variable zapatista66[_9_] Excel Programming 1 October 6th 04 08:47 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"