Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default MsgBox String 2



How do I get a MsgBox to display the value of a string
rather then the string name?
i.e.

Dim sName As String, sDate As String

sName = (Left(Range("B1"), 4))
sDate = "" & Format(DateSerial(Year(Date), Month
(Date) - 1, 1), " mmm yy ")

MsgBox "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

End Sub

and I get "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

I do not get the values of sName or sDate.

What am I doing wrong?

Thanks to Jim and Frank for their ideas. However using
Franks = "Invalid Qualifier" and Jim's = C:\Documents and
Settings\UserName\MyDocuments\sDate & EOM INFO\DATA INPUT

Thanks for any help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default MsgBox String 2

By NOT having it somewhere between a couple of quotes. Try this:

Sub test()
Dim S As String
Dim L As Long

S = " fish for sale"
L = 400

MsgBox L & S
MsgBox "L" & S
MsgBox L & "S"
MsgBox "L" & "S"
MsgBox "L & S"

End Sub

HTH. Best wishes Harald

"Ronbo" skrev i melding
...


How do I get a MsgBox to display the value of a string
rather then the string name?
i.e.

Dim sName As String, sDate As String

sName = (Left(Range("B1"), 4))
sDate = "" & Format(DateSerial(Year(Date), Month
(Date) - 1, 1), " mmm yy ")

MsgBox "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

End Sub

and I get "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

I do not get the values of sName or sDate.

What am I doing wrong?

Thanks to Jim and Frank for their ideas. However using
Franks = "Invalid Qualifier" and Jim's = C:\Documents and
Settings\UserName\MyDocuments\sDate & EOM INFO\DATA INPUT

Thanks for any help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default MsgBox String 2

Ronbo,

Try this:

MsgBox "C:\Documents and Settings\UserName\My
Documents\" & sName & sDate & "EOM INFO\DATA INPUT."

hth,

Doug Glancy

"Ronbo" wrote in message
...


How do I get a MsgBox to display the value of a string
rather then the string name?
i.e.

Dim sName As String, sDate As String

sName = (Left(Range("B1"), 4))
sDate = "" & Format(DateSerial(Year(Date), Month
(Date) - 1, 1), " mmm yy ")

MsgBox "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

End Sub

and I get "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

I do not get the values of sName or sDate.

What am I doing wrong?

Thanks to Jim and Frank for their ideas. However using
Franks = "Invalid Qualifier" and Jim's = C:\Documents and
Settings\UserName\MyDocuments\sDate & EOM INFO\DATA INPUT

Thanks for any help.



  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default MsgBox String 2

change Jims from:
MsgBox "C:\Documents and Settings\Ron Bowman\My
Documents\" & sName & "sDate & EOM INFO\DATA INPUT."
to
MsgBox "C:\Documents and Settings\Ron Bowman\My
Documents\" & sName & sDate & " EOM INFO\DATA INPUT."

-----Original Message-----


How do I get a MsgBox to display the value of a string
rather then the string name?
i.e.

Dim sName As String, sDate As String

sName = (Left(Range("B1"), 4))
sDate = "" & Format(DateSerial(Year(Date), Month
(Date) - 1, 1), " mmm yy ")

MsgBox "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

End Sub

and I get "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

I do not get the values of sName or sDate.

What am I doing wrong?

Thanks to Jim and Frank for their ideas. However using
Franks = "Invalid Qualifier" and Jim's = C:\Documents and
Settings\UserName\MyDocuments\sDate & EOM INFO\DATA INPUT

Thanks for any help.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default MsgBox String 2


-----Original Message-----
Ronbo,

Try this:

MsgBox "C:\Documents and Settings\UserName\My
Documents\" & sName & sDate & "EOM INFO\DATA INPUT."

hth,

Doug Glancy

"Ronbo" wrote in

message
...


How do I get a MsgBox to display the value of a string
rather then the string name?
i.e.

Dim sName As String, sDate As String

sName = (Left(Range("B1"), 4))
sDate = "" & Format(DateSerial(Year(Date), Month
(Date) - 1, 1), " mmm yy ")

MsgBox "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

End Sub

and I get "C:\Documents and Settings\UserName\My
Documents\& sName & sDate & EOM INFO\DATA INPUT."

I do not get the values of sName or sDate.

What am I doing wrong?

Thanks to Jim and Frank for their ideas. However using
Franks = "Invalid Qualifier" and Jim's = C:\Documents

and
Settings\UserName\MyDocuments\sDate & EOM INFO\DATA

INPUT

Thanks for any help.



.
Thanks a lot for your help. It works!!

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
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM
MsgBox & String Ronbo Excel Programming 3 August 31st 04 07:11 PM
Can I create a msgbox that is asking for a string to be typed in? Phillips Excel Programming 2 November 20th 03 02:18 AM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 07:39 AM.

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"