check blocks in loop

  • Thread starter Thread starter sybmathics
  • Start date Start date
S

sybmathics

Hi,

In a spreadsheet i want to check different sections for the presence of
value.

These sections are declared as block1, block2 .... block9.

Now I want a routine that loops through all 9 secioins or blocks where 1 is
raised to 2, 2 is raised to 3 etc.8 is raised to 9.

I this possible?

--
||//////||
( o o )
( O )
-
( )
( )
(______O______)
 
Not really clear but maybe

For each cell in block1
'do something
Next cell

For each cell in block2
'do something
Next cell

'etc.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Bob Phillips said:
Not really clear but maybe

For each cell in block1
'do something
Next cell

For each cell in block2
'do something
Next cell

'etc.

Thanks Bob for your quick reply.

What I'm looking for is something like

for counter is 1 to 9
for each cell in block&counter
do something
next cell
next counter

But the concatenation does not work.
There doesn't appear to be 1 string created because vba adds a space.

Maybe a bit clearer?

Any help is greatly appreciated.

greets

Sybmathics
 
If your blocks are named ranges:

sub LoopBlocks
dim i as integer
dim rBlock as range

for i = 1 to 9
set rBlock = Range("block" & i)
<do something with rBlock>
next i

end sub

HTH
 
Yes,

I see what you mean.

This one will certainly take me further.

Thanks a lot .

Cheers everybody!!

Sybmathics
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top