Msg boxes in VBA

C

Celtic_Avenger

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: :confused: :confused: :confused: :confused
 
C

Celtic_Avenger

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
:confused: :confused: :confused: :confused: :confused:
 
T

Tom Ogilvy

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)
 
B

Bob Phillips

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)
 
G

Guest

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
 
B

Bob Phillips

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

--

HTH

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

Guest

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
 
B

Bob Phillips

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)
 
G

Guest

I would love to get some mouseover code!

What email addy do I send the workbook to?

Sabrina
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top