ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   concatenate values of two cells (https://www.excelbanter.com/excel-programming/389388-concatenate-values-two-cells.html)

ll

concatenate values of two cells
 
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


Dave Peterson

concatenate values of two cells
 
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")



ll wrote:

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


--

Dave Peterson

Mike Fogleman

concatenate values of two cells
 
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
"ll" wrote in message
oups.com...
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




ll

concatenate values of two cells
 
On May 14, 5:16 pm, "Mike Fogleman"
wrote:
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"ll" wrote in message

oups.com...

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


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


Mike Fogleman

concatenate values of two cells
 
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
"ll" wrote in message
ps.com...
On May 14, 5:16 pm, "Mike Fogleman"
wrote:
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"ll" wrote in message

oups.com...

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


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





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

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