Link to home
Start Free TrialLog in
Avatar of shambalad
shambaladFlag for United States of America

asked on

Format line break in date for date and time

Hello -
I have a cell that is loaded with a time stamp. It is formatted as:

mm/dd/yy hh:nn AM/PM

I would like to format it so that the text is wrapped in the cell where the first line in the cell is the date and the second line is the time, such as:

mm/dd/yy
hh:nn AM/PM

How do I do this?

Thanks,
Todd
Avatar of Norie
Norie

If can goto Custom Format, place the cursor between the date and time then press CTRL+J.

That will put them time below the date but you'll need to set Word Wrap on for and resize the cell, so perhaps not ideal.
SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Slow fingers :)
Avatar of shambalad

ASKER

Still setting things up. I'll get back to you shortly on this.
I'm finding that the CTRL+J isn't really working for me.
I'd rather not have to use VBA to accomplish this.
What I am doing now is setting the custom format to:

mm/dd/yy h:mm AM/PM

The cell is formatted to wrap text. If I adjust the width, Excel appears to like breaking the line for the wrap between the 'mm/dd/yy' and the 'h:mm AM/PM".
This makes sense if you think about it.

Thanks for taking the time to look at this, but I am going to proceed with my own solution.
I've requested that this question be closed as follows:

Accepted answer: 0 points for shambalad's comment http:/Q_27410275.html#37012006

for the following reason:

This is working for me.
That will work, but you might need to adjust the width for different font sizes/styles etc.
I'm using to load a worksheet, so I have complete control of all properties while this is happening.
No problem, like I said what I suggested probably isn't ideal anyway.:)
>>I'm finding that the CTRL+J isn't really working for me.

I tried it, and it's working just fine for me.
For what it's worth:
I just went back and played some more with the formatting; particularly the 'CTRL+J' option. As far as I can tell, it doesn't change the behavior of the text in the cell vis-a-vis how the text breaks on wrapping over different cell widths. I tried a number of different widths. I even tried inserting the 'CTRL+J' at different locations in the string to see what that would do. It was ineffective.
If you're desperate for the points, I'll give them to you.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi shambalad,

I hope you will find my comment 37012683 to be an acceptable solution.

Sincerely,
Girard Andrew
The formatting with chr(10) does work.
Because of the very specific circumstances of the worksheet I am currently developing, I don't really need to go through the extra steps this solution requires (just locking in the width is going to work this time). Nonetheless, I do know that I will probably use the 'Chr(10)' solution in the future when the requirements dictate as much.
Thanks again for all your help.
Todd
Geez -
The points assignment process certainly became convoluted for this question. It's my fault. This is the first time I've turned around and tried to accept a solution and award points while a request to close without awarding points was still open.
I've have been working on this particular application for about 18 hours a day for the last week, so I'm not quite my usual self at the moment. I got a little snippy with you, Matthew; and for that I sincerely apologize. I'm intensely focused on getting this project done for Monday, and the ongoing conversation here has been an unwanted distraction. But I really need to cool my jets a little. I appreciate all the help I get on this forum (probably more than you people will ever realize), so if I ask for help, I need to put aside the time and do my part to make certain the issue is thoroughly worked through to its conclusion.
In my comment at http:#a37012786, I was trying to explain my rationale for changing my mind and splitting the points between suggestions from Girard and Matthew. After posting that comment, I tried to go through the process of accepting and awarding points. Apparently that step didn't take.
Anyway it was, and remains, my intent to split the points between comments http:#a37012683 and http:#a37011730.
I am going to make a request to reopen this question so that I can close it out properly.
Again, I am most grateful for the efforts of all the experts on this forum.
Regards,
Todd Harpham
Thanks again,
Todd