Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Help with Message Box Please

Hi Everyone,

I have a Program that I Wrote Directly into a Module that Runs and
Lists Combinations. It Cycles through the Combinations ( Taking out
those that I Do Not Need ) and then Prints them out Starting in Cell
"A1" of the Active WorkSheet.
What I would like it to do is to Tell me How Many Combinations there
are to be Printed, and Give me the Option of Printing Them to the
Active Sheet Or NOT.
I Managed to get a Message Box that Just Gave me the Total
Combinations BUT it Still Printed them to the Active Sheet.

I have Already Tried in Different Parts of the Code :-
Dim Count As Long
Count = 0
Count = Count + 1
MsgBox Count

I Know I Need to use :-
vbYesNoCancel
Somehow, but I Do Not know How to.

I Would Ideally Like the Message Box to Say :-
There Are "x" Combinations That Meet The Criteria You Specified, Do
You Want To Print Them?.

Thanks in Advance
Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Help with Message Box Please

Paul, this would be the basic construct..

note that when the msgbox must return a result, it's arguments must
be in brackets.

if vbyes = Msgbox("There Are " count & "combinations!" & _
vbnewline & "Print 'm? " ,vbYesNo) then
'do it
else
Msgbox "Why dit you run it then?"
endif


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Paul Black wrote :

Hi Everyone,

I have a Program that I Wrote Directly into a Module that Runs and
Lists Combinations. It Cycles through the Combinations ( Taking out
those that I Do Not Need ) and then Prints them out Starting in Cell
"A1" of the Active WorkSheet.
What I would like it to do is to Tell me How Many Combinations there
are to be Printed, and Give me the Option of Printing Them to the
Active Sheet Or NOT.
I Managed to get a Message Box that Just Gave me the Total
Combinations BUT it Still Printed them to the Active Sheet.

I have Already Tried in Different Parts of the Code :-
Dim Count As Long
Count = 0
Count = Count + 1
MsgBox Count

I Know I Need to use :-
vbYesNoCancel
Somehow, but I Do Not know How to.

I Would Ideally Like the Message Box to Say :-
"x" Combinations That Meet The Criteria You Specified, Do
You Want To Print Them?.

Thanks in Advance
Paul


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Help with Message Box Please

Thanks keepITcool for the Response,

Unfortunately I keep getting an error on :-
if vbyes = Msgbox("There Are " count & "combinations!" & _
vbnewline & "Print 'm? " ,vbYesNo) then
Do you have any suggestions please?.

Thanks very much
Paul



"keepITcool" wrote in message ...
Paul, this would be the basic construct..

note that when the msgbox must return a result, it's arguments must
be in brackets.

if vbyes = Msgbox("There Are " count & "combinations!" & _
vbnewline & "Print 'm? " ,vbYesNo) then
'do it
else
Msgbox "Why dit you run it then?"
endif


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Paul Black wrote :

Hi Everyone,

I have a Program that I Wrote Directly into a Module that Runs and
Lists Combinations. It Cycles through the Combinations ( Taking out
those that I Do Not Need ) and then Prints them out Starting in Cell
"A1" of the Active WorkSheet.
What I would like it to do is to Tell me How Many Combinations there
are to be Printed, and Give me the Option of Printing Them to the
Active Sheet Or NOT.
I Managed to get a Message Box that Just Gave me the Total
Combinations BUT it Still Printed them to the Active Sheet.

I have Already Tried in Different Parts of the Code :-
Dim Count As Long
Count = 0
Count = Count + 1
MsgBox Count

I Know I Need to use :-
vbYesNoCancel
Somehow, but I Do Not know How to.

I Would Ideally Like the Message Box to Say :-
"x" Combinations That Meet The Criteria You Specified, Do
You Want To Print Them?.

Thanks in Advance
Paul

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Help with Message Box Please

Try the following. I think you were missing the & between "There Are " and
Count.

If vbYes = MsgBox("There Are " & Count & " combinations!" & _
vbNewLine & "Print? ", vbYesNo) Then


--
Michael J. Malinsky
Pittsburgh, PA

"I am a bear of very little brain, and long
words bother me." -- AA Milne, Winnie the Pooh

"Paul Black" wrote in message
...
Thanks keepITcool for the Response,

Unfortunately I keep getting an error on :-
if vbyes = Msgbox("There Are " count & "combinations!" & _
vbnewline & "Print 'm? " ,vbYesNo) then
Do you have any suggestions please?.

Thanks very much
Paul



"keepITcool" wrote in message

...
Paul, this would be the basic construct..

note that when the msgbox must return a result, it's arguments must
be in brackets.

if vbyes = Msgbox("There Are " count & "combinations!" & _
vbnewline & "Print 'm? " ,vbYesNo) then
'do it
else
Msgbox "Why dit you run it then?"
endif


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Paul Black wrote :

Hi Everyone,

I have a Program that I Wrote Directly into a Module that Runs and
Lists Combinations. It Cycles through the Combinations ( Taking out
those that I Do Not Need ) and then Prints them out Starting in Cell
"A1" of the Active WorkSheet.
What I would like it to do is to Tell me How Many Combinations there
are to be Printed, and Give me the Option of Printing Them to the
Active Sheet Or NOT.
I Managed to get a Message Box that Just Gave me the Total
Combinations BUT it Still Printed them to the Active Sheet.

I have Already Tried in Different Parts of the Code :-
Dim Count As Long
Count = 0
Count = Count + 1
MsgBox Count

I Know I Need to use :-
vbYesNoCancel
Somehow, but I Do Not know How to.

I Would Ideally Like the Message Box to Say :-
"x" Combinations That Meet The Criteria You Specified, Do
You Want To Print Them?.

Thanks in Advance
Paul



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
message box Hein Excel Discussion (Misc queries) 2 October 21st 08 07:10 AM
#N/A Message Daviv Excel Discussion (Misc queries) 4 February 6th 07 11:33 PM
Message JG Excel Worksheet Functions 3 December 28th 06 02:51 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM


All times are GMT +1. The time now is 09:17 AM.

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

About Us

"It's about Microsoft Excel"