ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MsgBox & String 3 (https://www.excelbanter.com/excel-programming/308548-msgbox-string-3-a.html)

ronbo

MsgBox & String 3
 
Thanks a lot to all that have helped me for you time and
expertise.

I now know how to use msgbox for debugging strings.

What I have found is that in the my code the sName string
does not work - using the following the msgbox show
nothing.

Dim sName As String, sDate As String

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

MsgBox sName & sDate

End Sub

= date only, no name

sName is suppose to get the first four letters in
cell "B1". Any Ideas why it does not do it.

Again, thanks for all of the help.

Yan Robidoux[_12_]

MsgBox & String 3
 
seriously im really not sure about that... as i'm NO expert and i don
have time to try it... but i think the problem might be the first se
of bracket ()

sName = (Left(Range("B1"), 4))

try

sName = Left(Range("B1"), 4)

as i said im NOT sure but it might be that....

if it help im happy... if not im sorry to made you lose your time..

--
Message posted from http://www.ExcelForum.com


Doug Glancy

MsgBox & String 3
 
Ronbo,

It might be that you are not referring to the right worksheet. Try a fully
qualified range name like:

sName = (Left(Workbooks("myBook").Worksheets("mySheet").Ra nge("B1"), 4))

hth,

Doug Glancy

"Ronbo" wrote in message
...
Thanks a lot to all that have helped me for you time and
expertise.

I now know how to use msgbox for debugging strings.

What I have found is that in the my code the sName string
does not work - using the following the msgbox show
nothing.

Dim sName As String, sDate As String

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

MsgBox sName & sDate

End Sub

= date only, no name

sName is suppose to get the first four letters in
cell "B1". Any Ideas why it does not do it.

Again, thanks for all of the help.





All times are GMT +1. The time now is 10:28 PM.

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