concatenate values of two cells

  • Thread starter Thread starter ll
  • Start date Start date
L

ll

How do you go about setting the value of one cell equal to a text
string of the value of one cell, &, and the value of another cell?
Specifically, I'm trying to refer to the date values of my begin and
end dates on my timesheet.

Thanks,
Louis
 
with activesheet
.range("a1").value = format(.range("b1"),"mm/dd/yyyy") _
& " to " _
& format(.range("b2"), "mm/dd/yyyy")
end with

But you could do the same thing with a formula in the cell:

=text(b1,"mm/dd/yyyy") & " to " & text(b2,"mm/dd/yyyy")
 
It sounds like you want Concatenate the start and end date in one cell, as
text, when the start and end dates are dates, not text.

=CONCATENATE(TEXT(E1,"m/d/yyyy")," - ",TEXT(F1,"m/d/yyyy"))
where E1 is start date and F1 is end date.

Mike F
 
It sounds like you want Concatenate the start and end date in one cell, as
text, when the start and end dates are dates, not text.

=CONCATENATE(TEXT(E1,"m/d/yyyy")," - ",TEXT(F1,"m/d/yyyy"))
where E1 is start date and F1 is end date.

Thanks Dave and Mike,
Yes, I am wanting to list start and end dates, separated by a dash,
etc. The cells to which this will refer get their values from yet
another worksheet. I tried the "with active sheet..." code, but I got
the reference to the cells, rather than the actual values. Could this
be a formatting problem?

Thanks again,
Louis
 
No I wouldn't think so. Dave's code uses the value in the cell. A date is
really a serial number that Excel formats to a particular date type display,
which Dave also specified. There must be some other underlying reason.

Mike F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top