For Each x in Range
Instead of Selection, use the variable q. Am I missing something still?
--
Vasant
"Craig" wrote in message
...
To follow up with my previous post, this is what I have so far. This
particular example finds an instance in the range where the cell value is
a
number, then changes the text color to red, then prints the sheet. After
it's printed, it sets the color back to black (It doesn't work, though...)
Sub PrintThis()
For Each q In Range("Range").Cells
If q.Value < 0 Then
Selection.Font.ColorIndex = 3
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Selection.Font.ColorIndex = 0
End If
Next q
End Sub
--
Craig
"Vasant Nanavati" wrote:
"Craig" wrote in message
...
Is there a way to reference a particular cell this way (the only way I
can
think of is to NOT use the For Each method, and instead, literally
select
each cell in the range and use the Activecell.Offset method to advance
to
the
next cell, etc.
Why? That's a terrible idea.
Dim c As Range
For Each c In Range("A1:Z100").Cells
'If c.Value is whatever Then do whatever
Next
--
Vasant
|