View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
LDSXena LDSXena is offline
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/