Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning a list names from a schedule
Hi, I'm working on schedule program for work where I Employee_Name in column
A and Date in row 1. the table then gets filled in with a symbol for the shift worked or is left blank. I am trying to create a list of the eployees working each day (i.e. Cell value not blank) I tried doing a ForEach loop but was obviouly not getting it right. Any suggestions/comments would be appriciated Thanbks Zb Kornecki |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning a list names from a schedule
Maybe something like this untested pseudocode.
Sub GenerateList() dim rw as Long, rng as Range, cell as Range dim rng1 as Range, cell1 as Range Dim sh as Worksheet Dim rw = 2 set sh = worksheets("Schedule") set sh1 = Worksheets("List") sh1.Range("A1:C1") = Array("Name","Date","Symbol") set rng = sh.Range(sh.cells(2,1),sh.cells(2,1).End(xldown)) for each cell in rng if application.CountA(cell.Entirerow) 1 then set rng1 = sh.range(cell.offset(0,1),sh.Cells(cell.row,"IV"). End(xltoLeft)) for each cell1 in rng1 if cell1 < "" then with sh1 cells(rw,1).Value = cell.Value cells(rw,2).Value = cells(1,cell.column).Value cells(rw,3).Value = cell1.value rw = rw + 1 end if end if Next End sub -- Regards, Tom Ogilvy "Zb Kornecki" wrote: Hi, I'm working on schedule program for work where I Employee_Name in column A and Date in row 1. the table then gets filled in with a symbol for the shift worked or is left blank. I am trying to create a list of the eployees working each day (i.e. Cell value not blank) I tried doing a ForEach loop but was obviouly not getting it right. Any suggestions/comments would be appriciated Thanbks Zb Kornecki |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning a list names from a schedule
Thank you I'll work w/ this and see how it works Zb
"Tom Ogilvy" wrote: Maybe something like this untested pseudocode. Sub GenerateList() dim rw as Long, rng as Range, cell as Range dim rng1 as Range, cell1 as Range Dim sh as Worksheet Dim rw = 2 set sh = worksheets("Schedule") set sh1 = Worksheets("List") sh1.Range("A1:C1") = Array("Name","Date","Symbol") set rng = sh.Range(sh.cells(2,1),sh.cells(2,1).End(xldown)) for each cell in rng if application.CountA(cell.Entirerow) 1 then set rng1 = sh.range(cell.offset(0,1),sh.Cells(cell.row,"IV"). End(xltoLeft)) for each cell1 in rng1 if cell1 < "" then with sh1 cells(rw,1).Value = cell.Value cells(rw,2).Value = cells(1,cell.column).Value cells(rw,3).Value = cell1.value rw = rw + 1 end if end if Next End sub -- Regards, Tom Ogilvy "Zb Kornecki" wrote: Hi, I'm working on schedule program for work where I Employee_Name in column A and Date in row 1. the table then gets filled in with a symbol for the shift worked or is left blank. I am trying to create a list of the eployees working each day (i.e. Cell value not blank) I tried doing a ForEach loop but was obviouly not getting it right. Any suggestions/comments would be appriciated Thanbks Zb Kornecki |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
return a list of names, from a large list of repeated names. | Excel Worksheet Functions | |||
I want to make a weekend schedule without duplication of names | Excel Discussion (Misc queries) | |||
create a schedule without repeating names | Excel Discussion (Misc queries) | |||
create a random list of names from a list of names in EXCEL | Excel Worksheet Functions | |||
find names on list 1 in list 2. list 1 4000 names list 2 400 name | Excel Worksheet Functions |