Bolding Subtotals
O R ion,
I'm so sorry - my eyes aren't what they used to be ;-) staring too hard at code examples....
Bernie
MS Excel MVP
"Orion Cochrane" wrote in message
...
Thanks, Bernie. Your macro worked like a charm!
BTW, my name is Orion, not Onion. Don't worry. When I write my name, my "r"
looks like an "n" and it reads as "Onion" anyways :)
--
Please rate posts so we know when we have answered your questions. Thanks.
"Bernie Deitrick" wrote:
Onion,
You would want to search the formula string, not the text
Sub Macro1()
Dim myC As Range
For Each myC In Cells.SpecialCells(xlCellTypeFormulas, 23)
If InStr(1, myC.Formula, "SUBTOTAL") 0 Then
myC.Font.Bold = True
End If
Next myC
End Sub
HTH,
Bernie
MS Excel MVP
"Orion Cochrane" wrote in message
...
Excel 2003:
I was wondering if there is a way to write a macro that would bold any
subtotal on a worksheet. What I was thinking of doing is have some sort of
Do/Loop macro with a LEFT function where if Left(ActiveCell.Text, 9) =
"=SUBTOTAL" then bold the cell. It would then search all cells in the
worksheet with that condition and would look until, say, the activerow is
blank (or a better cutoff if you can think of one). I work with a lot of
reports and there are some who would like to use this macro, and I am the
only one who would know how to run it and where to install it to make it
available to others. Thanks.
--
Please rate posts so we know when we have answered your questions. Thanks.
|