Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Question: Range().Select for more than one row?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select All question P D Sterling New Users to Excel 4 August 31st 08 03:53 AM
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
rows().select VBA question mohavv Excel Discussion (Misc queries) 2 December 2nd 07 06:43 AM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
VBA select case question Jeff Excel Discussion (Misc queries) 2 January 27th 06 03:03 AM


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"