Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Combined text and variable in a message box

I'm trying to display message box that combines text along with a
variable that was previously defined. The following code only
displays the date that's contained in the variable Dt, but it doesn't
display the text. How can this be done?


Dt = "Records prior to " & Dt & " have been removed"
MsgBox Dt

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Combined text and variable in a message box

This works just fine for me.
Dt = 5
Dt = "Records prior to " & Dt & " have been removed"
MsgBox Dt

Not sure why it's not working for you. You could always use something
like:
Dt = 5
MsgBox "Records prior to " & Dt & " have been removed"
or
Dt = 5
msgString = "Records prior to " & Dt & " have been removed"
MsgBox msgString

wrote:
I'm trying to display message box that combines text along with a
variable that was previously defined. The following code only
displays the date that's contained in the variable Dt, but it doesn't
display the text. How can this be done?


Dt = "Records prior to " & Dt & " have been removed"
MsgBox Dt

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Combined text and variable in a message box

Hi

your code seems ok though it looks like you are changing the data held
in Dt to the string of text rather than your date variable??

MsgBox "Records prior to " & Dt & " have been removed"

seems to work fine for me.

S


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Combined text and variable in a message box


MsgBox "Records prior to " & Dt & " have been removed"

--
Regards,
Tom Ogilvy


" wrote:

I'm trying to display message box that combines text along with a
variable that was previously defined. The following code only
displays the date that's contained in the variable Dt, but it doesn't
display the text. How can this be done?


Dt = "Records prior to " & Dt & " have been removed"
MsgBox Dt

Thanks.


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
error message "Some chart types cannot be combined with other char n_alexiou Charts and Charting in Excel 6 May 19th 23 03:42 AM
text combined with values gloucester county Excel Discussion (Misc queries) 3 May 28th 10 03:09 PM
Text in a combined spreadsheet Davidfalkirk Excel Discussion (Misc queries) 0 March 9th 09 11:14 AM
Figures and text combined Sarah P[_2_] Excel Worksheet Functions 2 February 27th 07 08:09 AM
text and values combined in one cel Bart Excel Discussion (Misc queries) 1 December 14th 04 08:36 AM


All times are GMT +1. The time now is 08:16 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"