View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Question: Range().Select for more than one row?

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.valuea then msgbox "Message"
next


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

"Hannibal" wrote in message
om...
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?