Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RTP RTP is offline
external usenet poster
 
Posts: 4
Default Detecting text fits into column

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Detecting text fits into column

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
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
Detecting text and returning a value Confuddled User!!!!!!!!!!!!! Excel Discussion (Misc queries) 6 August 28th 07 04:04 PM
How do I list all Data in a column that fits between two points? Jason Excel Discussion (Misc queries) 2 February 22nd 07 04:51 PM
Formula for detecting a certain pattern in a particular row or column? [email protected] Excel Programming 2 February 7th 07 10:23 PM
Detecting if a value "fits" in a cell. Robert Mulroney[_3_] Excel Programming 10 November 15th 05 10:20 PM
detecting row or column insertion & deletion arun Excel Programming 5 July 28th 04 07:26 PM


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

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

About Us

"It's about Microsoft Excel"