Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 50
Default How do I format a MSGBOX to show text and variables in a macro?

I have a macro that receives a variable that is input by a user (&rsp1)

I want a MsgBox to display Do you want to print off the data for and the
variable &rsp1.

The MsgBox lookes like:-

MsgBox "Do you want to print off the data for &rsp1 - 1?", vbYesNo, "Do you
want to Print off

Additionally, if I know the location of a particular file, how do I
incorporate an open to it?

Any assistance offered will be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,101
Default How do I format a MSGBOX to show text and variables in a macro?

I'm not sure i ub=nderstand the second part of your question but try this for
the first bit.

Sub givemesomeinput()
rsp1 = InputBox("Respond please?", vbYesNo)
msg = " Do you want to print off the data for " & rsp1
MsgBox (msg)
End Sub

"Pank" wrote:

I have a macro that receives a variable that is input by a user (&rsp1)

I want a MsgBox to display Do you want to print off the data for and the
variable &rsp1.

The MsgBox lookes like:-

MsgBox "Do you want to print off the data for &rsp1 - 1?", vbYesNo, "Do you
want to Print off

Additionally, if I know the location of a particular file, how do I
incorporate an open to it?

Any assistance offered will be appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,593
Default How do I format a MSGBOX to show text and variables in a macro?

MsgBox "Do you want to print off the data for " & rsp1 & "- 1?", _
vbYesNo, "Do you want to Print off"


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Pank" wrote in message
...
I have a macro that receives a variable that is input by a user (&rsp1)

I want a MsgBox to display "Do you want to print off the data for "and the
variable &rsp1.

The MsgBox lookes like:-

MsgBox "Do you want to print off the data for &rsp1 - 1?", vbYesNo, "Do
you
want to Print off"

Additionally, if I know the location of a particular file, how do I
incorporate an open to it?

Any assistance offered will be appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 324
Default How do I format a MSGBOX to show text and variables in a macro?

MsgBox("Do you want to print off the data for " &rsp1 - 1?), vbYesNo
If MsgBox = vbNo then
'Skip over the print command and go to next line of code.


Workbooks.open("C:\MyDocuments\ExcelFiles\MyFilena me.xls")

You will be prompted for Update Links?, ReadOnly? etc. You can ignore these
unless you need the file to update links etc.

--
Best wishes,

Jim


"Pank" wrote:

I have a macro that receives a variable that is input by a user (&rsp1)

I want a MsgBox to display Do you want to print off the data for and the
variable &rsp1.

The MsgBox lookes like:-

MsgBox "Do you want to print off the data for &rsp1 - 1?", vbYesNo, "Do you
want to Print off

Additionally, if I know the location of a particular file, how do I
incorporate an open to it?

Any assistance offered will be appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 50
Default How do I format a MSGBOX to show text and variables in a macro

Thanks guys, just what the Doctor ordered.


"Bob Phillips" wrote:

MsgBox "Do you want to print off the data for " & rsp1 & "- 1?", _
vbYesNo, "Do you want to Print off"


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Pank" wrote in message
...
I have a macro that receives a variable that is input by a user (&rsp1)

I want a MsgBox to display "Do you want to print off the data for "and the
variable &rsp1.

The MsgBox lookes like:-

MsgBox "Do you want to print off the data for &rsp1 - 1?", vbYesNo, "Do
you
want to Print off"

Additionally, if I know the location of a particular file, how do I
incorporate an open to it?

Any assistance offered will be appreciated.




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
Macro - MsgBox Dileep Chandran Excel Worksheet Functions 2 December 6th 06 05:59 AM
Macro - msgbox traima Excel Worksheet Functions 1 September 13th 06 03:20 PM
How to Bold text in MsgBox? [email protected] Excel Discussion (Misc queries) 1 July 29th 06 04:24 AM
Why does formula show rather than results (not in text format) Caseybay Excel Worksheet Functions 4 April 24th 06 08:51 PM
How to center text in a msgbox Dave_2k5 Excel Discussion (Misc queries) 2 July 26th 05 01:20 PM


All times are GMT +1. The time now is 11:51 PM.

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"