Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default refer cell using c

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 possibl

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default refer cell using c

Before loop:
Set Orig = ActiveCell

After loop:
Orig.Offset(1).Select

"anupam " wrote:

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


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default refer cell using c

anupam < wrote:

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


---
Message posted from http://www.ExcelForum.com/

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
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
How to refer to a range except one cell hs Excel Discussion (Misc queries) 4 December 6th 09 11:05 PM
refer to last cell in worksheet? svh646 Excel Worksheet Functions 2 July 25th 06 01:23 AM
How make hyperlink refer to cell content rather than cell address. Omunene Excel Discussion (Misc queries) 3 March 2nd 06 01:07 AM
How to refer to every 5 th cell? R.P.McMurphy Excel Discussion (Misc queries) 21 August 27th 05 06:13 PM
How do I refer a Range to a Cell Mal Excel Worksheet Functions 6 June 7th 05 08:47 AM


All times are GMT +1. The time now is 05:01 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"