Question: Range().Select for more than one row?

  • Thread starter Thread starter Hannibal
  • Start date Start date
H

Hannibal

Hi,

I need some help with a little VBA problem:

Is there any way to test cells in a range, say 10x10, within one or two loop(s)?

I figured out how I can do it in a row, but I need a whole range.
my Code:

Counter = 0
Range("A1").Select
Do While Counter < 10
If ActiveCell.Value > a Then MsgBox " Message "
Counter = Counter + 1
ActiveCell.Next.Select
Loop

any idea for my solution?
 
Hi Hannibal,

you dont need to select; it just slows things down.
Try something like

dim oCell as range

for each oCell in Range("A1:z99")
if ocell.value>a then msgbox "Message"
next


Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com
 
Back
Top