refer cell using c

  • Thread starter Thread starter anupam
  • Start date Start date
A

anupam

The following code where each cell in the the range is referred

for each c in Range("......")
-------
 
Before loop:
Set Orig = ActiveCell

After loop:
Orig.Offset(1).Select
 
anupam said:
The following code where each cell in the the range is referred

for each c in Range("......")
-------
--------
next c

after exiting from for loop i want it to refer immediate next cell.
how can it be possible
Immediate next cell after what cell??? Bob Umlas provided code to refer
to the next cell *down* from the cell that was active immediately prior
to the loop. If you meant the next cell to the *right* of the cell that
was active immediately prior to the loop, then you could use

Orig.Offset(0,1)

If you meant the next cell after the last cell in the range through
which the code loops, you could use


Set rng = Range("......")(Range("......").Count + 1)
or
Set rng = Range("......")(Range("......").Rows.Count, _
Range("......").Columns.Count + 1)

depending on what you meant by "the next cell".

Alan Beban
 

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