View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
 
Posts: n/a
Default Can i "filter" in excel by words in Bold?

Roger,

Shapes are bad :-( , at least for use in a worksheet. But we can get around that with a macro.
Run the macro below when the sheet with the rectangles is active, and see if it finds all of your
text boxes. And then let us know, and we'll go from there.

HTH,
Bernie
MS Excel MVP


Sub FindRogersTextBoxes()
Dim myShape As Object
Dim i As Long
Dim myLeftCol As Integer
Dim myRow As Long

For Each myShape In ActiveSheet.Shapes
For i = 1 To 255
If Columns(i).Left = myShape.Left Then
myLeftCol = i - IIf(Columns(i).Left < myShape.Left, 1, 0)
GoTo FoundCol
End If
Next i
FoundCol:
For i = 1 To Rows.Count
If Rows(i).Top = myShape.Top Then
myRow = i - IIf(Rows(i).Top < myShape.Top, 1, 0)
GoTo FoundRow
End If
Next i
FoundRow:
MsgBox myShape.Name & " contains the text: " & _
myShape.TextFrame.Characters.Text & Chr(10) & _
"And is located at " & _
Cells(myRow, myLeftCol).Address(False, False)
Next myShape

End Sub


"Roger" wrote in message
...
Thank you for taking time to reply.
Im afraid im going to show my lack of familiarity with excel here.
They are not typical cells, nor are they merged cells. I am not certain i
would call them drawing objects, as i am able to edit the text with in them.
The best description i can give is a text box. I crosses the lines of the
rows in the column in which is resides.
As you can probably tell, these are in files i did not create but which i
must edit.

Is that any better?

"Bernie Deitrick" wrote:

It depends, on what you mean by "text boxes". Are you refering to cells, cells that are merged,
or
to the drawing objects?

HTH,
Bernie
MS Excel MVP


"Roger" wrote in message
...
What I want to do is to consecutively number a list of file names. These
files are in text boxes in column B. Each text box covers a varying number of
rows. So files names contain multiple text boxes. The distinguishing
feature is that the first line of a text box containing a new file is in
BOLD.
I am trying to filter for just the lines which contain words in BOLD so that
i can then number the files in Col A.

The second part of the question is:
Once i have the list filtered to hide the unwanted rows, is there a
way to use the automatic numbering feature of excel (ie number the first two
cell 1 and 2 then dragging through the rest of the cells to number the
others) and get it to only number the cells shown by the filter, to skip the
hidden rows.