Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Msg boxes in VBA

Tis me again!

I want to make a message box show the details of two cells.

For example:

Your minimum sales today must be £4500

The 4500 comes from a cell value, which will change from week to week.

How do I change the Msgbox code to do this?

Thanks
Celtic_Avenger
:confused

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Msg boxes in VBA

"Celtic_Avenger " ha scritto
nel messaggio ...

I want to make a message box show the details of two cells.



MsgBox (Range("A1") & Chr(13) & Range("A2"))


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Msg boxes in VBA

Thanks for your help cucchiaino,

I have amended that code to the following..........

MsgBox (Range("AC6") & Range("AD6") & Range("AE6"))

to take into account the cells I needed to use......however how do I
now change the Title of the Msgbox?

I want the title to show "Expected Sales" and not "Microsoft Excel".

Thanks

Celtic_Avenger



---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Msg boxes in VBA

as shown in Help

msgbox Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales

Note that you don't encase the arguments in parentheses unless you are
getting a return value such as

res = msgbox(Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales)

--
Regards,
Tom Ogilvy



"Celtic_Avenger " wrote in
message ...
Thanks for your help cucchiaino,

I have amended that code to the following..........

MsgBox (Range("AC6") & Range("AD6") & Range("AE6"))

to take into account the cells I needed to use......however how do I
now change the Title of the Msgbox?

I want the title to show "Expected Sales" and not "Microsoft Excel".

Thanks

Celtic_Avenger



---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Msg boxes in VBA

Thanks Tom and cucchiaino for all your help.


Celtic_Avenger
:) :) :) :) :

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Msg boxes in VBA

This post is extremely helpful to me except that I need to pull the data from
a different sheet. I've played with a couple syntaxes but I'm not getting
the right one. Could someone tell me how to specify which sheet to draw the
data from?

Thanks all!
LDSXena

"Tom Ogilvy" wrote:

as shown in Help

msgbox Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales

Note that you don't encase the arguments in parentheses unless you are
getting a return value such as

res = msgbox(Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales)

--
Regards,
Tom Ogilvy



"Celtic_Avenger " wrote in
message ...
Thanks for your help cucchiaino,

I have amended that code to the following..........

MsgBox (Range("AC6") & Range("AD6") & Range("AE6"))

to take into account the cells I needed to use......however how do I
now change the Title of the Msgbox?

I want the title to show "Expected Sales" and not "Microsoft Excel".

Thanks

Celtic_Avenger



---
Message posted from http://www.ExcelForum.com/




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Msg boxes in VBA

Something like

With Worksheets("Sheet")
msgbox Prompt:=.Range("AC6") & .Range("AD6") & .Range("AE6"), _
Title:="Exptected Sales
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
This post is extremely helpful to me except that I need to pull the data

from
a different sheet. I've played with a couple syntaxes but I'm not getting
the right one. Could someone tell me how to specify which sheet to draw

the
data from?

Thanks all!
LDSXena

"Tom Ogilvy" wrote:

as shown in Help

msgbox Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales

Note that you don't encase the arguments in parentheses unless you are
getting a return value such as

res = msgbox(Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales)

--
Regards,
Tom Ogilvy



"Celtic_Avenger " wrote

in
message ...
Thanks for your help cucchiaino,

I have amended that code to the following..........

MsgBox (Range("AC6") & Range("AD6") & Range("AE6"))

to take into account the cells I needed to use......however how do I
now change the Title of the Msgbox?

I want the title to show "Expected Sales" and not "Microsoft Excel".

Thanks

Celtic_Avenger



---
Message posted from http://www.ExcelForum.com/






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Msg boxes in VBA

Taking what you said, here is how I adapted the code to my program. When the
compiler gets it though it says "Compiler error: Expected end of statement"
then highlights "Msgbox." My programming is C++ and Java based so some sort
of grammatical mark makes sense to me after I declare which sheet to work on.
Obviously I'm not familiar with VB so can anyone debug this for me?

Sub show_Question01()
'
' show_Question1 Macro
' This macro shows the user the text to Question 1 in the chart.
'
With Worksheets("Data w Charts")
Msgbox Prompt:=.Range("B1") _
Title:="Question Text"
End With

End Sub

Thanks all!
Sabrina

"Bob Phillips" wrote:

Something like

With Worksheets("Sheet")
msgbox Prompt:=.Range("AC6") & .Range("AD6") & .Range("AE6"), _
Title:="Exptected Sales
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
This post is extremely helpful to me except that I need to pull the data

from
a different sheet. I've played with a couple syntaxes but I'm not getting
the right one. Could someone tell me how to specify which sheet to draw

the
data from?

Thanks all!
LDSXena

"Tom Ogilvy" wrote:

as shown in Help

msgbox Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales

Note that you don't encase the arguments in parentheses unless you are
getting a return value such as

res = msgbox(Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales)

--
Regards,
Tom Ogilvy



"Celtic_Avenger " wrote

in
message ...
Thanks for your help cucchiaino,

I have amended that code to the following..........

MsgBox (Range("AC6") & Range("AD6") & Range("AE6"))

to take into account the cells I needed to use......however how do I
now change the Title of the Msgbox?

I want the title to show "Expected Sales" and not "Microsoft Excel".

Thanks

Celtic_Avenger



---
Message posted from http://www.ExcelForum.com/







  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Msg boxes in VBA

You removed the comma after the message contents

Sub show_Question01()
'
' show_Question1 Macro
' This macro shows the user the text to Question 1 in the chart.
'
With Worksheets("Data w Charts")
MsgBox Prompt:=.Range("B1"), _
Title:="Question Text"
End With

End Sub




--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
Taking what you said, here is how I adapted the code to my program. When

the
compiler gets it though it says "Compiler error: Expected end of

statement"
then highlights "Msgbox." My programming is C++ and Java based so some

sort
of grammatical mark makes sense to me after I declare which sheet to work

on.
Obviously I'm not familiar with VB so can anyone debug this for me?

Sub show_Question01()
'
' show_Question1 Macro
' This macro shows the user the text to Question 1 in the chart.
'
With Worksheets("Data w Charts")
Msgbox Prompt:=.Range("B1") _
Title:="Question Text"
End With

End Sub

Thanks all!
Sabrina

"Bob Phillips" wrote:

Something like

With Worksheets("Sheet")
msgbox Prompt:=.Range("AC6") & .Range("AD6") & .Range("AE6"), _
Title:="Exptected Sales
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
This post is extremely helpful to me except that I need to pull the

data
from
a different sheet. I've played with a couple syntaxes but I'm not

getting
the right one. Could someone tell me how to specify which sheet to

draw
the
data from?

Thanks all!
LDSXena

"Tom Ogilvy" wrote:

as shown in Help

msgbox Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales

Note that you don't encase the arguments in parentheses unless you

are
getting a return value such as

res = msgbox(Prompt:=Range("AC6") & Range("AD6") & Range("AE6"), _
Title:="Exptected Sales)

--
Regards,
Tom Ogilvy



"Celtic_Avenger "

wrote
in
message ...
Thanks for your help cucchiaino,

I have amended that code to the following..........

MsgBox (Range("AC6") & Range("AD6") & Range("AE6"))

to take into account the cells I needed to use......however how do

I
now change the Title of the Msgbox?

I want the title to show "Expected Sales" and not "Microsoft

Excel".

Thanks

Celtic_Avenger



---
Message posted from http://www.ExcelForum.com/









  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Msg boxes in VBA

Thanks for your quick replies!

I know I'm being a pain now but I copied and pasted the code into my macro
and it's still giving me the same error. The compiler wants something before
MsgBox. I'm completely in the dark as to what it wants.

Sabrina

"Bob Phillips" wrote:

You removed the comma after the message contents

Sub show_Question01()
'
' show_Question1 Macro
' This macro shows the user the text to Question 1 in the chart.
'
With Worksheets("Data w Charts")
MsgBox Prompt:=.Range("B1"), _
Title:="Question Text"
End With

End Sub




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Msg boxes in VBA

I just tried it again, and it worked fine form me.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
Thanks for your quick replies!

I know I'm being a pain now but I copied and pasted the code into my macro
and it's still giving me the same error. The compiler wants something

before
MsgBox. I'm completely in the dark as to what it wants.

Sabrina

"Bob Phillips" wrote:

You removed the comma after the message contents

Sub show_Question01()
'
' show_Question1 Macro
' This macro shows the user the text to Question 1 in the chart.
'
With Worksheets("Data w Charts")
MsgBox Prompt:=.Range("B1"), _
Title:="Question Text"
End With

End Sub




  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Msg boxes in VBA

Hmmmm . . . I just don't know why it won't work for me.

Just to clarify incase I haven't explained the situation well and that's why
the code works for you and not me . . . I have a chart on a stand-alone
sheet. I have another sheet called "Data w Charts" that contains the data.
Because the questions get long, I don't want the question texts as the
labels. I took out the labels all together and put text boxes instead with
the question number. Right now I have macros taking the user to the actual
spreadsheet and cell with the question text. I already know my boss won't
like that so I'm trying to get a box or some sort of message to pop up with
question text. Idealy, I would like some sort of mouseover box that appears
over hot spots and disappears when the user moves the mouse off but I have no
clue where to begin for that sort of thing.

Oh great mind what can you conceive for my pitiful self? !o)

Thanks
Sabrina


"Bob Phillips" wrote:

I just tried it again, and it worked fine form me.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
Thanks for your quick replies!

I know I'm being a pain now but I copied and pasted the code into my macro
and it's still giving me the same error. The compiler wants something

before
MsgBox. I'm completely in the dark as to what it wants.

Sabrina

"Bob Phillips" wrote:

You removed the comma after the message contents

Sub show_Question01()
'
' show_Question1 Macro
' This macro shows the user the text to Question 1 in the chart.
'
With Worksheets("Data w Charts")
MsgBox Prompt:=.Range("B1"), _
Title:="Question Text"
End With

End Sub


  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Msg boxes in VBA

So, are you saying that the question is in a textbox and you want to get
that? If so, where does Range("B12) come into it?

BTW If you send me the workbook, I can add some mouseover code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
Hmmmm . . . I just don't know why it won't work for me.

Just to clarify incase I haven't explained the situation well and that's

why
the code works for you and not me . . . I have a chart on a stand-alone
sheet. I have another sheet called "Data w Charts" that contains the

data.
Because the questions get long, I don't want the question texts as the
labels. I took out the labels all together and put text boxes instead

with
the question number. Right now I have macros taking the user to the

actual
spreadsheet and cell with the question text. I already know my boss won't
like that so I'm trying to get a box or some sort of message to pop up

with
question text. Idealy, I would like some sort of mouseover box that

appears
over hot spots and disappears when the user moves the mouse off but I have

no
clue where to begin for that sort of thing.

Oh great mind what can you conceive for my pitiful self? !o)

Thanks
Sabrina


"Bob Phillips" wrote:

I just tried it again, and it worked fine form me.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
Thanks for your quick replies!

I know I'm being a pain now but I copied and pasted the code into my

macro
and it's still giving me the same error. The compiler wants something

before
MsgBox. I'm completely in the dark as to what it wants.

Sabrina

"Bob Phillips" wrote:

You removed the comma after the message contents

Sub show_Question01()
'
' show_Question1 Macro
' This macro shows the user the text to Question 1 in the chart.
'
With Worksheets("Data w Charts")
MsgBox Prompt:=.Range("B1"), _
Title:="Question Text"
End With

End Sub




  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Msg boxes in VBA

I would love to get some mouseover code!

What email addy do I send the workbook to?

Sabrina
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Msg boxes in VBA

bob dot phillips at tiscali dot co dot uk

do the obvious with that

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LDSXena" wrote in message
...
I would love to get some mouseover code!

What email addy do I send the workbook to?

Sabrina



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
Data validation boxes, outputting a final number from the boxes MDH Excel Discussion (Misc queries) 1 November 16th 06 12:41 AM
Moving. Want to number boxes and inventory contents of boxes [email protected] Charts and Charting in Excel 1 August 29th 06 09:48 AM
Selecting subsets using combo boxes or list boxes CLamar Excel Discussion (Misc queries) 0 June 1st 06 07:43 PM
Questions on combo boxes and list boxes. Marc New Users to Excel 1 March 14th 06 09:40 AM
How do i create a value for check boxes or option boxes Tim wr Excel Discussion (Misc queries) 1 February 9th 06 10:29 PM


All times are GMT +1. The time now is 04:23 AM.

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"