PC Review


Reply
Thread Tools Rate Thread

Automatic adjustment of Cell height?

 
 
Tristan
Guest
Posts: n/a
 
      13th Apr 2007
Hi,

I'm using automation to start Excel and fill some columns with data. Once
of the columns has quite a bit of text in some of the cells while some only
have few lines.

I've set TextWrap=.t. for each Cell, but it doesn't adjust the height. Is
there an excel property that I can call to do this automatcially, or some
other way of working out how high each cell should be sized.

Thanks


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      13th Apr 2007
If I were doing it in excel, I'd use something like:

activesheet.rows(35).autofit
(to set a specific row)

or
activesheet.rows.autofit
(to do all of them)

or
activesheet.range("a1:A99").entirerow.autofit
(to get a range of rows




Tristan wrote:
>
> Hi,
>
> I'm using automation to start Excel and fill some columns with data. Once
> of the columns has quite a bit of text in some of the cells while some only
> have few lines.
>
> I've set TextWrap=.t. for each Cell, but it doesn't adjust the height. Is
> there an excel property that I can call to do this automatcially, or some
> other way of working out how high each cell should be sized.
>
> Thanks


--

Dave Peterson
 
Reply With Quote
 
Tristan
Guest
Posts: n/a
 
      13th Apr 2007
This is my code:

SELECT QResults
SCAN
WITH oRange
..Columns[1].Value=QResults.wrkovertm
..Columns[2].Value=QResults.wrkdate
..Columns[3].Value=QResults.wrkbilling
..Columns[4].Value=ALLTRIM(QResults.wrkdesc)
..Columns[4].WrapText = .T.
..Columns[4].VerticalAlignment = -4160
..Columns[4].autofit
..Columns[5].Value=QResults.staffnm
Endwith


* Move range down one row
oRange = oRange.Offset(1,0)


Endscan

I added the autofit in the above code, and all it did was make each cell
exactly the same size. So if there is 2 lines of text in them, the hight
has been made so large that it shows about 10 more lines of extra white
space underneath the text.

Maybe I didn't do it right?

Thanks for your help



"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If I were doing it in excel, I'd use something like:
>
> activesheet.rows(35).autofit
> (to set a specific row)
>
> or
> activesheet.rows.autofit
> (to do all of them)
>
> or
> activesheet.range("a1:A99").entirerow.autofit
> (to get a range of rows
>
>
>
>
> Tristan wrote:
>>
>> Hi,
>>
>> I'm using automation to start Excel and fill some columns with data.
>> Once
>> of the columns has quite a bit of text in some of the cells while some
>> only
>> have few lines.
>>
>> I've set TextWrap=.t. for each Cell, but it doesn't adjust the height.
>> Is
>> there an excel property that I can call to do this automatcially, or some
>> other way of working out how high each cell should be sized.
>>
>> Thanks

>
> --
>
> Dave Peterson



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Cell Height Adjustment for text entered Solex Microsoft Excel Misc 3 19th Jun 2009 01:18 PM
Automatic row height adjustment nsv Microsoft Excel Misc 5 27th Jan 2006 07:38 AM
Row height - automatic adjustment Benelly Microsoft Excel Discussion 6 7th Sep 2004 01:39 AM
Automatic row height adjustment? Rich N Microsoft Excel Worksheet Functions 0 22nd Apr 2004 08:41 PM
cell height adjustment SNS Microsoft Excel Worksheet Functions 2 28th Aug 2003 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:29 AM.