Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to using Range ?
How to using Range selection to check cell have formated using "color
index=35". Sub Macro1() With Selection.Interior .ColorIndex = 35 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With End Sub Step1 . Select a area by rows. Step2. Run sub ErCheckColor How to write below code to check cell have formated with color index =35, if not selected row set "0" otherwise set "1". Sub ErCheckColor() areaCount = Selection.Areas.Count If areaCount <= 1 Then MsgBox "The selection contains " & _ Selection.Rows.Count & " rows." Else I = 1 For Each a In Selection.Areas MsgBox "Area " & I & " of the selection contains " & _ a.Rows.Count & " rows." I = I + 1 Next a End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming | |||
how to? set my range= my UDF argument (range vs. value in range) [advanced?] | Excel Programming |