LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Offsetting to identify value in header row



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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Offsetting Dan Wood Excel Discussion (Misc queries) 3 March 3rd 10 03:23 PM
identify sheet number in header? Steve Excel Discussion (Misc queries) 5 December 9th 08 12:29 AM
How Do I Identify 1 to 1 Offsetting Entries in a List? [email protected] Excel Programming 3 October 6th 06 11:38 PM
Offsetting a varible?? Ashley Milford via OfficeKB.com Excel Programming 5 June 2nd 05 03:38 PM
Identify Cell by Column Header and ID in Col A (Track Changes) Bettergains Excel Programming 1 April 4th 05 01:33 PM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"