View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Clif McIrvin[_3_] Clif McIrvin[_3_] is offline
external usenet poster
 
Posts: 203
Default Looping through Non contiguous cells in a row

"avi" wrote in message
...
Hello,

I want to loop accross each cell in a row oa a non contiguous range,
something like

for I=1 to NumberOfRows
for J=1 to NumberOfCols
msgbox MyRange.Rows(I).cells(I,J).value
next
next

The problem is that the J seems to refer to the contiguous range
starting with first column of the range



try changing
msgbox MyRange.Rows(I).cells(I,J).value


to
msgbox MyRange.cells(I,J).value

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)