Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, that is correct, but it takes too long (<--relative) to format all of
those individually even with screenupdating turned off. thanks "Ronin" wrote: why not put the .Interior.ColorIndex line within the If statement? Sub gg() Dim t(40000) As Range, z As Long For x = 1 To 40000 If Condition Then z = z + 1 Set t(z) = Range("A1")(x) t(z).Interior.ColorIndex = 39 '<--- like this End If Next End Sub or you would have to create another For statement... Sub gg() Dim t(40000) As Range, z As Long For x = 1 To 40000 If Condition Then z = z + 1 Set t(z) = Range("A1")(x) End If Next 'Below line creates another For Statement For z = 0 To UBound(t, 1) t(z).Interior.ColorIndex = 39 Next End Sub Ronin "Stewart" wrote: I want to do something similar to this. Can it be done? Sub gg() Dim t(40000) As Range, z as long z=0 For x = 1 To 40000 If CONDITION THEN z=z+1 Set t(z) = Range("A1")(x) end if Next t().Interior.ColorIndex = 39 End Sub Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Relative references in arrays | Excel Discussion (Misc queries) | |||
How to rename references from range names to cell references | Excel Discussion (Misc queries) | |||
Using arrays or range in IF function - HELP PLS | Excel Worksheet Functions | |||
Dynamic Range and arrays | Excel Discussion (Misc queries) | |||
Arrays: Subscript out of range | Excel Programming |