View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MJKelly MJKelly is offline
external usenet poster
 
Posts: 114
Default Offsetting to identify value in header row


Rick,

Thanks for the help.

The following line works when I only query one row. As soon as I
attempt to loop through multiple rows nothing happens.
r.Value = Cells(3, c.Column).Value

I have a table headed with ten minute time windows. I want each row
to be checked so the time of the first task (first nonblank
timewindow) is input to column B of the same row. Ithink the error
lies in the third row of code below? How do I loop through a range
which is based on an offset of the current cell?

ThisWorkbook.Sheets("Monday").Select
For Each r In Range("D4:D10")
For Each c In Range(r.Address).Offset(0,
4).Range(r.Address).Offset(0, 147)
If Not c.Value = "" Then
r.Value = Cells(3, c.Column).Value
Exit For
Else
End If
Next c
Next r

Hope this makes it clerarer?
Matt