Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looping cells

Status
Not open for further replies.

everytime

Programmer
Feb 21, 2001
31
GB
Hi,

I have a range object and I would like to be able to loop through all the cells and change certain properties of them IF there text say a certain thing. Can someone advise me how to do this? Might look something like this but how do I reference a CELL (refereed to below as c)?

Dim Area As range

Set Area = Worksheets("test").range("D11:X22")

For Each c In Area
If c.Value > limit Then
c.Interior.ColorIndex = 27
End If
Next c


Many thanks for any help

Everytime
 
Dim oRange As Range
Dim oCell As Range

Set oRange = Worksheets("Sheet1").Range("A9:B12")
For Each oCell In oRange.Cells
Debug.Print oCell.Text
Next oCell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top