"?B?UGFwYSBKb25haA==?="
wrote in :
Have a look at this site for the first problem:
http://www.apostate.com/programming/vb-format.html
The problem is that 'bb' probably returns the Long-format of the date.
You have to change this using the 'Format'-function, thus:
,Format(bb,"dd-mm-yy"), instead of ,bb,
For the 2nd problem, I can't really tell what's wrong.
HTH,
CoRrRan
I am trying to use the concatenate function in a cell that will
ultimately be part of a legend in an automated chart.
It is driving me crazy because I do this manually time and again
without issue but vba is not very congenial.
One problem I am having with the code is that the bb is showing up as
a number instead of the date format (this works manually).
Second, as I assemble the string, it seems to quit working as I add
the part that addresses endbase2.
With Range("x1")
.Value = begbase
.NumberFormat = "m/d/yy"
.Name = "bb"
End With
With Range("z1")
.Value = reviewbeg - 1
.NumberFormat = "M/D/YY"
.Name = "endbase2"
End With
Range("aa1").FormulaR1C1 = "=concatenate(""Baseline: "",bb,""
through
"",endbase2,""(Total "",basetypetotal,""events; Yearly avg
"",baselineannrate,"")"
Any thoughts would be much appreciated.
TIA