text wrapping in excel

  • Thread starter Thread starter gil eiliya
  • Start date Start date
G

gil eiliya

hi.

i'm building a program in vb6 on win98, i am using excel to build a
shipping bill, using data i get from my data base, my biggest problem
is that i have a long text field in the DB that i need to insert in
the excel worksheet, i know how to select few adjusting cells, merge
them to one cell, (using a macro), i insert the long text to the cell,
i use a text wrapping macro i builded, but then the cell continues to
span only one row height even if there are 2 or more lines of text
wrapped, here is my problem how do i find how many wrapped lines is
there so i can resize the row to the right height according to the
number of lines?, i know that in excel if you press alt + enter keys
when you write a long text you break the text into new lines, but how
do i find how many rows?

thanks in advance for any help.
gil eiliya.
 
Hi gil,

With Worksheets(1).Range("myRange")
.WrapText = True
.Rows.AutoFit
End With
 
Back
Top