Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default filling a table depending on header row name

Hi,

Can you help me with the code below?
I'm trying to fill a status taken from column b and put it in a table
in between two time values. the first time value is c.offset(0,1) and
the second is c.offset(0,2). In the table the times are held in row
1. The status will be sick or holiday etc, if the person is at work
they have a numeric duty code hence the isnumeric check. Once the
status has been filled to the time window, the next "c" in the range
is checked.

For Each c In Sheets("Staff Monday").Range("B2:B100")
isDuty = IsNumeric(c.Value)
If isDuty = False Then
Status = c.Value
For Each r In Range(c.Offset(0, 5), c.Offset(0, 148))
If Cells(1, r.Column).Value = c.Offset(0, 1) Then
r.Value = Status

Do Until Cells(1, r.Column).Value = c.Offset(0, 2).Value
r.Offset(0, MyOffset).Value = Status
MyOffset = MyOffset + 1
Loop
End If


Next r
End If
Next c

regards,
Matt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default filling a table depending on header row name

It would help if you'd tell us what was wrong with the original answer
instead of reposting the question again.

"MJKelly" wrote:

Hi,

Can you help me with the code below?
I'm trying to fill a status taken from column b and put it in a table
in between two time values. the first time value is c.offset(0,1) and
the second is c.offset(0,2). In the table the times are held in row
1. The status will be sick or holiday etc, if the person is at work
they have a numeric duty code hence the isnumeric check. Once the
status has been filled to the time window, the next "c" in the range
is checked.

For Each c In Sheets("Staff Monday").Range("B2:B100")
isDuty = IsNumeric(c.Value)
If isDuty = False Then
Status = c.Value
For Each r In Range(c.Offset(0, 5), c.Offset(0, 148))
If Cells(1, r.Column).Value = c.Offset(0, 1) Then
r.Value = Status

Do Until Cells(1, r.Column).Value = c.Offset(0, 2).Value
r.Offset(0, MyOffset).Value = Status
MyOffset = MyOffset + 1
Loop
End If


Next r
End If
Next c

regards,
Matt

Reply
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
filling a table based on header row name MJKelly Excel Programming 1 October 4th 08 08:58 PM
filling a table based on header row name MJKelly Excel Programming 1 October 4th 08 10:56 AM
filling a table depending on column heading MJKelly Excel Programming 0 September 24th 08 11:25 PM
filling a row with data, depending on certain criteria MJKelly Excel Programming 2 November 19th 07 03:25 PM
Filling cells depending on two conditions dziw Excel Worksheet Functions 1 September 22nd 05 04:29 PM


All times are GMT +1. The time now is 02:49 AM.

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

About Us

"It's about Microsoft Excel"