Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can I use variables in the text portion of a message box?



Title says it all practically. I have a msgbox pop up at times in my
code to tell me about progress plateaus. What I want to do is
incorporate cell value calls, etc. in the msgbox text. Can I use
"CONCATENATE" or other cell functions within macro code?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Can I use variables in the text portion of a message box?

On Thu, 12 Aug 2010 04:07:35 -0700, AllInTheChi
wrote:



Title says it all practically. I have a msgbox pop up at times in my
code to tell me about progress plateaus. What I want to do is
incorporate cell value calls, etc. in the msgbox text. Can I use
"CONCATENATE" or other cell functions within macro code?


Yes. Just use the concatenation operator ( & ) to produce your
string.

Something like:

var1 = "Is the Date "
var2 = #9/1/2010#
var3 = " OK?"

s = var1 & var2 & var3
MsgBox (s)
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can I use variables in the text portion of a message box?

On Thu, 12 Aug 2010 07:47:46 -0400, Ron Rosenfeld wrote:

On Thu, 12 Aug 2010 04:07:35 -0700, AllInTheChi
wrote:



Title says it all practically. I have a msgbox pop up at times in my
code to tell me about progress plateaus. What I want to do is
incorporate cell value calls, etc. in the msgbox text. Can I use
"CONCATENATE" or other cell functions within macro code?


Yes. Just use the concatenation operator ( & ) to produce your
string.

Something like:

var1 = "Is the Date "
var2 = #9/1/2010#
var3 = " OK?"

s = var1 & var2 & var3
MsgBox (s)


Cool. Thanks. I keep forgetting about making declarations right there
in the code.

Can I use range names and thereby extract cell values on the fly?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Can I use variables in the text portion of a message box?

Example... Application.WorksheetFunction.Sum
Use "&" in place of Concatenate... "Smith" & "Wesson" equals "SmithWesson"
See "List of Worksheet Functions" in Excel help.
--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html

..
..
..

"AllInTheChi"
wrote in message
...
Title says it all practically. I have a msgbox pop up at times in my
code to tell me about progress plateaus. What I want to do is
incorporate cell value calls, etc. in the msgbox text. Can I use
"CONCATENATE" or other cell functions within macro code?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Can I use variables in the text portion of a message box?

On Thu, 12 Aug 2010 04:52:18 -0700, AllInTheChi
wrote:

On Thu, 12 Aug 2010 07:47:46 -0400, Ron Rosenfeld wrote:

On Thu, 12 Aug 2010 04:07:35 -0700, AllInTheChi
wrote:



Title says it all practically. I have a msgbox pop up at times in my
code to tell me about progress plateaus. What I want to do is
incorporate cell value calls, etc. in the msgbox text. Can I use
"CONCATENATE" or other cell functions within macro code?


Yes. Just use the concatenation operator ( & ) to produce your
string.

Something like:

var1 = "Is the Date "
var2 = #9/1/2010#
var3 = " OK?"

s = var1 & var2 & var3
MsgBox (s)


Cool. Thanks. I keep forgetting about making declarations right there
in the code.

Can I use range names and thereby extract cell values on the fly?


Yes


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can I use variables in the text portion of a message box?

On Thu, 12 Aug 2010 19:42:47 -0400, Ron Rosenfeld wrote:

On Thu, 12 Aug 2010 04:52:18 -0700, AllInTheChi
wrote:

On Thu, 12 Aug 2010 07:47:46 -0400, Ron Rosenfeld wrote:

On Thu, 12 Aug 2010 04:07:35 -0700, AllInTheChi
wrote:



Title says it all practically. I have a msgbox pop up at times in my
code to tell me about progress plateaus. What I want to do is
incorporate cell value calls, etc. in the msgbox text. Can I use
"CONCATENATE" or other cell functions within macro code?

Yes. Just use the concatenation operator ( & ) to produce your
string.

Something like:

var1 = "Is the Date "
var2 = #9/1/2010#
var3 = " OK?"

s = var1 & var2 & var3
MsgBox (s)


Cool. Thanks. I keep forgetting about making declarations right there
in the code.

Can I use range names and thereby extract cell values on the fly?


Yes



Thanks to the both of you...
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
Formula to return a value for a portion of a text string in a cell NanGio Excel Discussion (Misc queries) 2 January 29th 09 10:36 PM
Extract a specific portion of text as new cell value Craig860 Excel Discussion (Misc queries) 6 March 20th 08 05:06 PM
How do I cut a portion of text out of a cell? jeff Excel Programming 7 March 7th 07 03:19 AM
Buttons in lower portion of workbook appear in upper portion ToferKing Excel Programming 1 April 22nd 06 06:46 PM
Remove portion of text from cells glenlee Excel Discussion (Misc queries) 1 September 24th 05 01:57 AM


All times are GMT +1. The time now is 06:19 PM.

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"