Click to See Complete Forum and Search --> : <RESOLVED> Justify text in cell
yorch
Jul 19th, 2006, 10:32 AM
Hi all,
What is the command to align text in a cell but not to left or right, I mean to distribute the text and making the cell height bigger.
Thanks in advance,
Y.
Static
Jul 19th, 2006, 12:52 PM
Columns("A:A").ColumnWidth = [NUMBER.. ex: 25]
Range("A1").HorizontalAlignment = xlCenter
there is also
xlFill and xlJustify, but they didnt seem to do anything?
VBAhack
Jul 19th, 2006, 02:59 PM
The best way to figure out things like this is to use the macro recorder - start the recorder, perform the tasks you want, stop the recorder, then look at the resulting code.
Static
Jul 19th, 2006, 03:53 PM
VBAHack!! dont tell them that! c'mon! it makes us seem so smart that we can figure stuff out soooo easily :) lol
Macros are your friend :)
DKenny
Jul 19th, 2006, 03:56 PM
Doh!
The secret is out ;-)
yorch
Jul 19th, 2006, 05:50 PM
Thanks all!, actually a friend told me about the macro recorder (something unknown for me) and there I found the exactly answer.
range("a1:c4").wraptext = true
jejeje, secret revealed. May be you will see me more often answering questions ;)
Y.
VBAhack
Jul 19th, 2006, 07:05 PM
Oops. I guess I'll be forever ostracized..... :eek:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.