View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Particular cell in Range

I like this:

dim myCell as range
dim iRow as long
dim iCol as long

set myCell = range("c9")
for irow = 0 to 4 '5 - 1
for icol = 0 to 9 '10 - 1
msgbox mycell.offset(irow,icol).value & _
mycell.offset(irow,icol).address
next icol
next irow

..offset is 0 based .offset(0,0) refers to the same cell.

mycell(x,y) is one's based. mycell(1,1) refers to itself.

Alan Beban has some notes at Chip Pearson's site that you may want to
read/print:

http://www.cpearson.com/excel/cells.htm


Ger wrote:

I have a square range from 5 rows and 10 cells.
How can i address a cell (in a macro) in this range so that i'm able to get
and put values into a cell (adressed by the row and colum).

I know it must be possible but i cant find the command in the helpfile.

Who can help me?

Thank in advance


--

Dave Peterson