View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nexus Nexus is offline
external usenet poster
 
Posts: 5
Default Looping through cells using VBA

For Each c In Range("A1:A10")
If c.Text = "WHATEVER YOUR LOOKING FOR" Then
..... Do what you want here
End If
Next c

In the example change the range to whatever you want and the check
condition.

This way you have multiple check conditions within a case statement and as
each cell is returned you can manipulate each cell very easily.

"Ann" wrote in message
...
I need to look through a range of cells to see if there is a match to a
variable I have previously set. What is the syntax for referencing this
range? Thanks.