PC Review


Reply
Thread Tools Rate Thread

Detecting text fits into column

 
 
=?Utf-8?B?UlRQ?=
Guest
Posts: n/a
 
      24th Feb 2007
How would I go about writing code to check an entire spreadsheet (every tab,
every cell that is not blank) for text/values that do not fir into a cell
(and are therefore not fully displayed. Also, to check that the same font is
used in the same tab. Once this has been detected I would like to
automatically create a summary sheet that lists the location of cells that
are not fully displayed.

Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      25th Feb 2007
The following will work with text and values which are not the result of
formulae:

Sub RTP()
'
' gsnuxx
'
j = 0
Set r1 = Sheets("sumry").Range("A1")
For Each w In Worksheets
If w.Name = "sumry" Then
Else
w.Activate
n = w.Name
For Each r In ActiveSheet.UsedRange
If IsEmpty(r.Value) Then
Else
r.Copy r1
w = r.Columns.Width
h = r.Rows.Height
r1.Columns.ColumnWidth = w
r1.Rows.RowHeight = h
r1.Columns.EntireColumn.AutoFit
If w < r1.Columns.Width Then
r1.Offset(j, 1).Value = n & " " & r.Address
j = j + 1
End If
End If
Next
End If
Next

The sub uses a "helper" sheet called "sumry". Cells are copied to cell A1
in "sumry" along with the cell's dimensions. Column A in "sumry" is then
autofit. If the column grew, then the original contents did not fit and the
results are recorded in column B.

This process is performed for all sheets and all cells within the sheets.
--
Gary's Student
gsnu200708


"RTP" wrote:

> How would I go about writing code to check an entire spreadsheet (every tab,
> every cell that is not blank) for text/values that do not fir into a cell
> (and are therefore not fully displayed. Also, to check that the same font is
> used in the same tab. Once this has been detected I would like to
> automatically create a summary sheet that lists the location of cells that
> are not fully displayed.
>
> Thanks

 
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
How do I list all Data in a column that fits between two points? =?Utf-8?B?SmFzb24=?= Microsoft Excel Misc 2 22nd Feb 2007 04:51 PM
Detecting if a value "fits" in a cell. =?Utf-8?B?Um9iZXJ0IE11bHJvbmV5?= Microsoft Excel Programming 10 15th Nov 2005 10:20 PM
PLS HELP: How to find ot if text fits a texbox/combobox MuZZy Microsoft C# .NET 1 10th May 2005 07:27 PM
How do I determine if text fits into my label or not? Dave Microsoft VB .NET 1 19th Jan 2005 07:24 PM
Determining if text fits in textbox =?Utf-8?B?anBhbGF0aW5l?= Microsoft Excel Programming 0 17th Mar 2004 02:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:48 AM.