Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
xlCellTypeSameFormatConditions
Hi everyone! How do I use the SpecialCells(xlCellTypeSameFormatConditions) method. can't make it understand what format I'm looking for. I want to select all cells in a sheet that is in blue & italic. Coul anyone please give me a samle code for this method. Thanks in advance Irad -- Irada Shamilov ----------------------------------------------------------------------- Irada Shamilova's Profile: http://www.excelforum.com/member.php...fo&userid=1228 View this thread: http://www.excelforum.com/showthread.php?threadid=27443 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
xlCellTypeSameFormatConditions
"Irada Shamilova" wrote in
message ... How do I use the SpecialCells(xlCellTypeSameFormatConditions) method. I can't make it understand what format I'm looking for. I want to select all cells in a sheet that is in blue & italic. Could anyone please give me a samle code for this method. Hi Irada, The xlCellTypeSameFormatConditions constant tells Excel that you want to find all the cells with the same *condition format* as the currently selected cell. It doesn't have anything to do with the formats that you apply to the cell using the Format/Cells menu, for example. The only way to do what you are trying to do is through brute force VBA enumeration of all the cells in the used range of the active worksheet. Here's one example of how it could be done: Sub SelectBlueItalicFont() Dim rngCell As Range Dim rngAccumulate As Range For Each rngCell In ActiveSheet.UsedRange If rngCell.Font.Italic And (rngCell.Font.ColorIndex = 5) Then If rngAccumulate Is Nothing Then Set rngAccumulate = rngCell Else Set rngAccumulate = Union(rngAccumulate, rngCell) End If End If Next rngCell If Not rngAccumulate Is Nothing Then rngAccumulate.Select End Sub -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
xlCellTypeSameFormatConditions | Excel Programming |