ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Format parts of cell differently (https://www.excelbanter.com/excel-discussion-misc-queries/227254-format-parts-cell-differently.html)

tony

Format parts of cell differently
 
I am using combining two time cells into one cell along with a separator of "
- ".

Source Cell J4 - "11:00 am"
Source Cell K4 - "11:30 am"

Target Cell C4 - "11:00 - 11:30 am"

How do can I do this and get the right formatting? I am currently getting:

0.34375 - 0.688194444444444


Dave Peterson

Format parts of cell differently
 
=text(j4,"hh:mm AM/PM") & " - " & text(k4,"hh:mm AM/PM")

I included the AM/PM in the formatting for the first time.

Tony wrote:

I am using combining two time cells into one cell along with a separator of "
- ".

Source Cell J4 - "11:00 am"
Source Cell K4 - "11:30 am"

Target Cell C4 - "11:00 - 11:30 am"

How do can I do this and get the right formatting? I am currently getting:

0.34375 - 0.688194444444444


--

Dave Peterson

tony

Format parts of cell differently
 
Dave, all I need to do now is apply to the following column/cell reference:

wsPh.Range("c" & EMcnt) =

"Dave Peterson" wrote:

=text(j4,"hh:mm AM/PM") & " - " & text(k4,"hh:mm AM/PM")

I included the AM/PM in the formatting for the first time.

Tony wrote:

I am using combining two time cells into one cell along with a separator of "
- ".

Source Cell J4 - "11:00 am"
Source Cell K4 - "11:30 am"

Target Cell C4 - "11:00 - 11:30 am"

How do can I do this and get the right formatting? I am currently getting:

0.34375 - 0.688194444444444


--

Dave Peterson


Dave Peterson

Format parts of cell differently
 
Does that mean you want to put the formula in that cell?

wsPh.Range("c" & EMcnt).Formula _
= "=text(j" & EMcnt & ",""hh:mm AM/PM"") & "" - """ _
& "&text(k" & EMcnt & ",""hh:mm AM/PM"")"



Tony wrote:

Dave, all I need to do now is apply to the following column/cell reference:

wsPh.Range("c" & EMcnt) =

"Dave Peterson" wrote:

=text(j4,"hh:mm AM/PM") & " - " & text(k4,"hh:mm AM/PM")

I included the AM/PM in the formatting for the first time.

Tony wrote:

I am using combining two time cells into one cell along with a separator of "
- ".

Source Cell J4 - "11:00 am"
Source Cell K4 - "11:30 am"

Target Cell C4 - "11:00 - 11:30 am"

How do can I do this and get the right formatting? I am currently getting:

0.34375 - 0.688194444444444


--

Dave Peterson


--

Dave Peterson

tony

Format parts of cell differently
 
Thanks Dave, works like a charm.

"Dave Peterson" wrote:

Does that mean you want to put the formula in that cell?

wsPh.Range("c" & EMcnt).Formula _
= "=text(j" & EMcnt & ",""hh:mm AM/PM"") & "" - """ _
& "&text(k" & EMcnt & ",""hh:mm AM/PM"")"



Tony wrote:

Dave, all I need to do now is apply to the following column/cell reference:

wsPh.Range("c" & EMcnt) =

"Dave Peterson" wrote:

=text(j4,"hh:mm AM/PM") & " - " & text(k4,"hh:mm AM/PM")

I included the AM/PM in the formatting for the first time.

Tony wrote:

I am using combining two time cells into one cell along with a separator of "
- ".

Source Cell J4 - "11:00 am"
Source Cell K4 - "11:30 am"

Target Cell C4 - "11:00 - 11:30 am"

How do can I do this and get the right formatting? I am currently getting:

0.34375 - 0.688194444444444

--

Dave Peterson


--

Dave Peterson



All times are GMT +1. The time now is 02:30 AM.

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