View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
hotherps[_79_] hotherps[_79_] is offline
external usenet poster
 
Posts: 1
Default loop through columns

Thanks Guys, here is the code:

Dim c 'don't know as what
Dim i As Integer
Dim rng As Range

On Error Resume Next
With Sheets("MonTest")
.Range("G11:CX125").ClearContents
End With
Range("G11:CX125").Formula
"=IF(AND(g$9=$B11,g$9<=$C11),""..."","""")"
Range("G11:CX125").Value = Range("G11:CX125").Value


For Each Cell In Range("G11:CX125")
c = Array(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
For i = 0 To 11
If Cells(356, c(i)).Value = Cells(305, c(i)) And Cell.Value "" _
And Cells(Cell.Row, c(i) + 97) = "x" Then _
Cell.Value = Cells(9, c(i) + 97)
Next i
Next


What it should do (not currently working) is to determine if 356 30
and + 97 = "x", and the cell value = ... If so place the the text tha
is in the corresponding cell. (One cell above)

Do this 8 columns at a time from D11 to CX125

Thanks
Ji

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