# How to wrap text in an Excel cell?

**URL:** <https://www.ruby-forum.com/t/how-to-wrap-text-in-an-excel-cell/142028>\
**Category:** Ruby\
**Created:** [July 2, 2008, 6:42pm UTC](https://www.ruby-forum.com/t/how-to-wrap-text-in-an-excel-cell/142028 "2008-07-02T18:42:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leshak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/977dab/32.png) [@leshak](https://www.ruby-forum.com/u/leshak)\
**Post date:** [July 2, 2008, 6:42pm UTC](https://www.ruby-forum.com/t/how-to-wrap-text-in-an-excel-cell/142028/1 "2008-07-02T18:42:11Z")

</div>

Hello,  
could you pls suggest how i can wrap text in Excel cell (row, column  
also)? I’m using win32ole library for working with excel format.  
Thanks.

---

<div class="post-metadata">

**Author:** ![leshak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/977dab/32.png) [@leshak](https://www.ruby-forum.com/u/leshak)\
**Post date:** [July 3, 2008, 7:48am UTC](https://www.ruby-forum.com/t/how-to-wrap-text-in-an-excel-cell/142028/2 "2008-07-03T07:48:33Z")

</div>

Alex … wrote:

> Hello,  
> could you pls suggest how i can wrap text in Excel cell (row, column  
> also)? I’m using win32ole library for working with excel format.  
> Thanks.

Here you can find a lot of usefull win32ole tips:

> **[Ruby on Windows](http://rubyonwindows.blogspot.com/)**
>
> On using the Ruby programming language on the Microsoft Windows platform

by  
TheR

---

<div class="post-metadata">

**Author:** ![leshak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/977dab/32.png) [@leshak](https://www.ruby-forum.com/u/leshak)\
**Post date:** [July 3, 2008, 9:08am UTC](https://www.ruby-forum.com/t/how-to-wrap-text-in-an-excel-cell/142028/3 "2008-07-03T09:08:45Z")

</div>

Thanks TheR,  
yes i know it’s very useful resource but i didn’t find any info about  
wrapping in excel ☹

---

<div class="post-metadata">

**Author:** ![leshak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/977dab/32.png) [@leshak](https://www.ruby-forum.com/u/leshak)\
**Post date:** [July 4, 2008, 9:14am UTC](https://www.ruby-forum.com/t/how-to-wrap-text-in-an-excel-cell/142028/4 "2008-07-04T09:14:57Z")

</div>

Thanks David!

---

<div class="post-metadata">

**Author:** ![leshak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/977dab/32.png) [@leshak](https://www.ruby-forum.com/u/leshak)\
**Post date:** [July 3, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/how-to-wrap-text-in-an-excel-cell/142028/5 "2008-07-03T23:56:44Z")

</div>

Alex … wrote:

> Hello,  
> could you pls suggest how i can wrap text in Excel cell (row, column  
> also)? I’m using win32ole library for working with excel format.  
> Thanks.

Set the WrapText property for the range object in question. Examples:

worksheet.Rows(1).WrapText = true  
worksheet.Columns(5).WrapText = true  
worksheet.Cells(10, 25).WrapText = true  
worksheet.Range(“A2:K30”).WrapText = true

David

> **[Ruby on Windows](http://rubyonwindows.blogspot.com)**
>
> On using the Ruby programming language on the Microsoft Windows platform

> **[Ruby on Windows](http://rubyonwindows.blogspot.com/search/label/excel)**
>
> On using the Ruby programming language on the Microsoft Windows platform
