Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Columns Autofix

I have 2 cells ETWS.Cells(j, i) & ETWS.Cells(1, i).

I compare the text width of this two cells, if cells(j,i) is larger than the
(1,i) then the columns width of column i is equal to textwidth of cells(j,i).

How can i do that ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel Columns Autofix

With ETWS
If .Cells(j,i).ColumnWidth .Cells(1,i).ColumnWidth Then
.Cells(1,i).ColumnWidth = .Cells(j,i).ColumnWidth
End If
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"WilliamMomo" wrote in message
...
I have 2 cells ETWS.Cells(j, i) & ETWS.Cells(1, i).

I compare the text width of this two cells, if cells(j,i) is larger than

the
(1,i) then the columns width of column i is equal to textwidth of

cells(j,i).

How can i do that ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Columns Autofix

Although its not work, also said thx.

"Bob Phillips" wrote:

With ETWS
If .Cells(j,i).ColumnWidth .Cells(1,i).ColumnWidth Then
.Cells(1,i).ColumnWidth = .Cells(j,i).ColumnWidth
End If
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"WilliamMomo" wrote in message
...
I have 2 cells ETWS.Cells(j, i) & ETWS.Cells(1, i).

I compare the text width of this two cells, if cells(j,i) is larger than

the
(1,i) then the columns width of column i is equal to textwidth of

cells(j,i).

How can i do that ?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Excel Columns Autofix

Perhaps you want to compare the number of characters, and if (j,i) has more
then autofit the column.

With ETWS
If Len(.Cells(j, i)) Len(.Cells(1, i)) Then
Columns(i).AutoFit
End If
End With

Mike F
"WilliamMomo" wrote in message
...
Although its not work, also said thx.

"Bob Phillips" wrote:

With ETWS
If .Cells(j,i).ColumnWidth .Cells(1,i).ColumnWidth Then
.Cells(1,i).ColumnWidth = .Cells(j,i).ColumnWidth
End If
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"WilliamMomo" wrote in message
...
I have 2 cells ETWS.Cells(j, i) & ETWS.Cells(1, i).

I compare the text width of this two cells, if cells(j,i) is larger
than

the
(1,i) then the columns width of column i is equal to textwidth of

cells(j,i).

How can i do that ?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Columns Autofix

thx alot for help i solve the problem la.

"Mike Fogleman" wrote:

Perhaps you want to compare the number of characters, and if (j,i) has more
then autofit the column.

With ETWS
If Len(.Cells(j, i)) Len(.Cells(1, i)) Then
Columns(i).AutoFit
End If
End With

Mike F
"WilliamMomo" wrote in message
...
Although its not work, also said thx.

"Bob Phillips" wrote:

With ETWS
If .Cells(j,i).ColumnWidth .Cells(1,i).ColumnWidth Then
.Cells(1,i).ColumnWidth = .Cells(j,i).ColumnWidth
End If
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"WilliamMomo" wrote in message
...
I have 2 cells ETWS.Cells(j, i) & ETWS.Cells(1, i).

I compare the text width of this two cells, if cells(j,i) is larger
than
the
(1,i) then the columns width of column i is equal to textwidth of
cells(j,i).

How can i do that ?








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
putting 2 long columns into multiple columns in excel page and sor bob_mhc Excel Discussion (Misc queries) 1 April 25th 08 07:51 AM
Excel 2003 - change columns to rows and rows to columns JLatham Excel Discussion (Misc queries) 0 August 17th 07 02:05 AM
"Text to Columns" for many columns in Excel 2003 NickName Excel Discussion (Misc queries) 12 September 8th 06 10:14 PM
unable to insert columns in excel, insert- columns (disabled) iam_leearner Excel Discussion (Misc queries) 1 August 13th 06 02:26 PM
Excel button :: Filter columns by value - possible? Additionally, hide certain columns No Name Excel Programming 4 December 28th 04 07:44 PM


All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"