Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default 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
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
xlCellTypeSameFormatConditions Robbie[_3_] Excel Programming 1 September 21st 03 03:45 AM


All times are GMT +1. The time now is 01:59 PM.

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"