Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, I am trying to use the concatenate operator to
combine 3 different individual strings with numbers in them into one string. Something like this: month = xx day = xx year = xx date = month & "/" & day & "/" & year But this doesn't work. Is this the correct operator to use for this kind of purpose and I am just using it incorrectly? Or is there a whole other way and I am missing something? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Brandon,
My first suggestion would be to use different variable names, month, day and year are functions and date is a property. Try your code again with things like myMonth, myDay, myYear and myDate, if it still acts up, post back Dan E "Brandon" wrote in message ... Hello, I am trying to use the concatenate operator to combine 3 different individual strings with numbers in them into one string. Something like this: month = xx day = xx year = xx date = month & "/" & day & "/" & year But this doesn't work. Is this the correct operator to use for this kind of purpose and I am just using it incorrectly? Or is there a whole other way and I am missing something? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, I did that already, the month/day/year was just for
showing what kind of number I am using to try and convert into a date. Any other ideas? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It looks correct to me then, what is the problem, does it output something
incorrect, nothing at all, etc . . . Perhaps a little more description would help. Dan E "Brandon" wrote in message ... Yes, I did that already, the month/day/year was just for showing what kind of number I am using to try and convert into a date. Any other ideas? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just that there is an error. Program execution breaks on
that line and the debugger highlights in yellow with a vague error message. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Post the "vague error message"
Dan E "Brandon" wrote in message ... Just that there is an error. Program execution breaks on that line and the debugger highlights in yellow with a vague error message. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
myday = 10
mymonth = 5 myyear = 2003 ? mymonth & "/" & myday & "/" & myyear 5/10/2003 ? cdate(mymonth & "/" & myday & "/" & myyear) 5/10/2003 ? format(cdate(mymonth & "/" & myday & "/" & myyear),"mmm dd, yyyy") May 10, 2003 What is "date" dimensioned as Sub testdate() Dim dtDate As Date myday = 10 mymonth = 5 myyear = 2003 dtDate = mymonth & "/" & myday & "/" & myyear Debug.Print dtDate End Sub worked. You can try msgbox isdate(mymonth & "/" & myday & "/" & myyear) & " " & _ mymonth & "/" & myday & "/" & myyear to see if vba sees your string as a date Regards, Tom Ogilvy "Brandon" wrote in message ... Just that there is an error. Program execution breaks on that line and the debugger highlights in yellow with a vague error message. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find and replace numeric strings in larger text strings | Excel Worksheet Functions | |||
Parsing Name Strings In Excel | Excel Discussion (Misc queries) | |||
Macro to apply parsing rules for strings and list the substrings | Excel Worksheet Functions | |||
How to find number of pairs of strings from list of strings? | Excel Worksheet Functions | |||
How can I count strings within strings | Excel Worksheet Functions |