word wrap in custom date formatting

merlin777

Well-known Member
Joined
Aug 29, 2009
Messages
1,397
Office Version
  1. 2007
I've got this:

sat o1 Jan

but I want this:

sat
o1
Jan

to keep my columns narrow.

I'm using a custom date format but word wrap doesn't seem to work with this. Is there a newline code i can use in the custom date template instead?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
This may be an option:-
Code:
Dim Rng As Range, Dn As Range
Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
For Each Dn In Rng
    Dn = Replace(Dn, " ", Chr(10))
Next Dn
Rng.Rows.AutoFit
Mick
 
Upvote 0
May this will help
Code:
Sub TestIt()
Dim LR As Long, c As Range
LR = Range("A" & Rows.Count).End(xlUp).Row
For Each c In Range("A2:A" & LR)
    c.Value = Format(c.Value, "ddd" & Chr(10) & "yy" & Chr(10) & "mmm")
Next c
End Sub

but the date will convert to text
 
Upvote 0
With a custom format the regular way, enter

ddd ALT+0010 dd ALT+0010 mmm

note that the codes entered with the ALT key must be done on the numberpad with NumLock on.
 
Upvote 0
I can't use vba because of the way we share workbooks. I was hoping the custom templates allowed for a split line?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,277
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top