Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, The code below is attempting to loop through a range of tasks (in a single row) and once a task is found, offset a given number (negative) of rows to capture the start time (which is in the header row) and paste this value into another column on the origianal row. Then I need the next row queried (the next job/person). I just can't get it right, please help? Sub AddStartTimes() Dim R As Range Dim ColOffset As Integer Dim RowOffset As Integer Dim C As Range RowOffset = 1 ColOffset = 0 ThisWorkbook.Sheets("Monday").Select For Each R In Range("D4:D1000") For Each C In Range("H4").Offset(RowOffset, 0).Range("EU4").Offset(RowOffset, 0) If Not C.Value = "" Then R.Value = C.Offset(0 - RowOffset, 0).Value Exit For Else ColOffset = ColOffset + 1 End If Next C RowOffset = RowOffset + 1 Next R End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Offsetting | Excel Discussion (Misc queries) | |||
identify sheet number in header? | Excel Discussion (Misc queries) | |||
How Do I Identify 1 to 1 Offsetting Entries in a List? | Excel Programming | |||
Offsetting a varible?? | Excel Programming | |||
Identify Cell by Column Header and ID in Col A (Track Changes) | Excel Programming |