ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   How do I format a MSGBOX to show text and variables in a macro? (https://www.excelbanter.com/new-users-excel/135967-how-do-i-format-msgbox-show-text-variables-macro.html)

Pank

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.


Mike

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.


Bob Phillips

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.




Jim Jackson

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.


Pank

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.






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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com