ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   make row height a little bigger in a wrapped cell (https://www.excelbanter.com/new-users-excel/248511-make-row-height-little-bigger-wrapped-cell.html)

Diane

make row height a little bigger in a wrapped cell
 
I've got a sheet with columns at work

date text (sometimes multi-line wrapped) $ nnnn.nn


I can wrap text no problem but I hope approximate double spacing so I
don't have to put a blank row between each item. I need the space
between items so the text isn't squashed all together for a court form

I guess I want to be able to say height of cell necessary for the
wrapped text however much it might be plus n for each row height.

I can't find a way. Is it possible?

Excel 2002 Win xp

Thanks for your help.

Dave Peterson

make row height a little bigger in a wrapped cell
 
If you're using merged cells, then this won't work.

But you could autofit the rowheight for all the cells--then add a little bit to
each of the row heights.

This kind of macro should work ok:

Option Explicit
Sub testme()

Dim iRow As Long
Dim wks As Worksheet
Dim ALittleBit As Double

ALittleBit = 3

Set wks = ActiveSheet

With wks.UsedRange
.Rows.AutoFit
For iRow = 1 To .Rows.Count
.Rows(iRow).RowHeight = .Rows(iRow).RowHeight + ALittleBit
Next iRow
End With

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Diane wrote:

I've got a sheet with columns at work

date text (sometimes multi-line wrapped) $ nnnn.nn

I can wrap text no problem but I hope approximate double spacing so I
don't have to put a blank row between each item. I need the space
between items so the text isn't squashed all together for a court form

I guess I want to be able to say height of cell necessary for the
wrapped text however much it might be plus n for each row height.

I can't find a way. Is it possible?

Excel 2002 Win xp

Thanks for your help.


--

Dave Peterson

Diane

make row height a little bigger in a wrapped cell
 
Thanks so much. No merged cells, they just seem to cause trouble for
me.

I'll try this macro tomorrow at work and let you know. Thanks again
for the response and the macro and links.


On Nov 15, 4:55*pm, Dave Peterson wrote:
If you're using merged cells, then this won't work.

But you could autofit the rowheight for all the cells--then add a little bit to
each of the row heights.

This kind of macro should work ok:

Option Explicit
Sub testme()

* * Dim iRow As Long
* * Dim wks As Worksheet
* * Dim ALittleBit As Double

* * ALittleBit = 3

* * Set wks = ActiveSheet

* * With wks.UsedRange
* * * * .Rows.AutoFit
* * * * For iRow = 1 To .Rows.Count
* * * * * * .Rows(iRow).RowHeight = .Rows(iRow).RowHeight + ALittleBit
* * * * Next iRow
* * End With

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros hehttp://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)



Diane wrote:

I've got a sheet with columns at work


date * * text (sometimes multi-line wrapped) * * *$ nnnn.nn


I can wrap text no problem but I hope approximate double spacing so I
don't have to put a blank row between each item. *I need the space
between items so the text isn't squashed all together for a court form


I guess I want to be able to say height of cell necessary for the
wrapped text however much it might be plus n for each row height.


I can't find a way. Is it possible?


Excel 2002 Win xp


Thanks for your help.


--

Dave Peterson



Diane

make row height a little bigger in a wrapped cell
 
Thanks again. It worked well after I adjusted a few things a little.

I'll be learning by taking this apart when I get a moment.

Diane



On Nov 15, 8:56*pm, Diane wrote:
Thanks so much. *No merged cells, they just seem to cause trouble for
me.

I'll try this macro tomorrow at work and let you know. *Thanks again
for the response and the macro and links.

On Nov 15, 4:55*pm, Dave Peterson wrote:

If you're using merged cells, then this won't work.


But you could autofit the rowheight for all the cells--then add a little bit to
each of the row heights.


This kind of macro should work ok:


Option Explicit
Sub testme()


* * Dim iRow As Long
* * Dim wks As Worksheet
* * Dim ALittleBit As Double


* * ALittleBit = 3


* * Set wks = ActiveSheet


* * With wks.UsedRange
* * * * .Rows.AutoFit
* * * * For iRow = 1 To .Rows.Count
* * * * * * .Rows(iRow).RowHeight = .Rows(iRow).RowHeight + ALittleBit
* * * * Next iRow
* * End With


End Sub


If you're new to macros:


Debra Dalgleish has some notes how to implement macros hehttp://www.contextures.com/xlvba01.html


David McRitchie has an intro to macros:http://www.mvps.org/dmcritchie/excel/getstarted.htm


Ron de Bruin's intro to macros:http://www.rondebruin.nl/code.htm


(General, Regular and Standard modules all describe the same thing.)


Diane wrote:


I've got a sheet with columns at work


date * * text (sometimes multi-line wrapped) * * *$ nnnn.nn


I can wrap text no problem but I hope approximate double spacing so I
don't have to put a blank row between each item. *I need the space
between items so the text isn't squashed all together for a court form


I guess I want to be able to say height of cell necessary for the
wrapped text however much it might be plus n for each row height.


I can't find a way. Is it possible?


Excel 2002 Win xp


Thanks for your help.


--


Dave Peterson




All times are GMT +1. The time now is 01:12 PM.

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