Originally Posted by
karmapala
Please have a look to the attachment.
Just click your Update Position Needs button on sheet STAFFING DATA,
select the combo box and fill the text-box with number.
Although I'm still don't know how exactly you want the result,
the code is only based on my guess as follow :
Pre-condition:
in STAFFING DATA sheet, the yellow highlighted cell is an indicator on how many rows on each PositionTitle,
and that also the same rows on sheet Days, Eves and Mids.
Take an example in your sample workbook, the PROCESS TECH yellow highlighted cell is 4. So...:
there are 4 rows under PROCESS TECH in sheet STAFFING DATA, and
there are 4 PROCESS TECH rows (with number 1 to 4 on the left) on Sheet Days, Eves and Mids,
disregarding whether there is a blank cell in that 4 rows or not.
Userform: (example)
the user select PROCESS TECH value in the ComboBox....
If A:
the user fill the TextBox with number 6, after the user click UPDATE button then the expected result is :
in STAFFING DATA sheet, now there are 6 rows under the PROCESS TECH and it's yellow highlighted cell is 6.
It happen also in sheet Days, Eves and Mids, there are 6 PROCESS TECH rows (with number 1 to 6 on the left).
The sheet Days, Eves and Mids will also have all the names respectively with the names (if any) under Days/Eves/Mids column in sheet STAFFING DATA.
If B:
the user fill the TextBox with number 2, after the user click UPDATE button then the expected result is :
in STAFFING DATA sheet, now there are 2 rows under the PROCESS TECH and it's yellow highlighted cell is 2.
(it won't bother to the existed names (under the PROCESS TECH) before... so if before there are 4 names, the last 2 names will be gone)
It happen also in sheet Days, Eves and Mids, there are 2 PROCESS TECH rows (with number 1 to 2 on the left).
(also it won't bother to the existed names (of the PROCESS TECH) before... so if before there are 4 names, the last 2 names will be gone)
The sheet Days, Eves and Mids will also have all the names respectively with the names (if any) under Days/Eves/Mids column in sheet STAFFING DATA.
If C:
nothing fill in the TextBox, after the user click UPDATE button then the expected result is :
nothing happen to the row, but only the names in sheet Days, Eves and Mids will be "updated" based on sheet STAFFING DATA and the selected ComboBox value.
disregarding whether there is any update to the names or not in sheet STAFFING DATA.
For example if C.... in sheet STAFFING DATA:
the current GROUP LEAD is Bardia Rajaei under Days column
the current GROUP LEAD is Adam Newton under Eves column
the current GROUP LEAD is Jason Stithem under Mids column
Later on, in sheet STAFFING DATA it change to bla, bli and ble respectively.
The need is only to update the name in sheet Days, Eves and Mids...
So, in the userform, just select the "GROUP LEAD" value in ComboBox,
and leave the TextBox empty, then click the UPDATE button,
the sheet Days Group Lead name now is bla
the sheet Eves Group Lead name now is bli
the sheet Mids Group Lead name now is ble
So that's my guess on what you want for the result.
Bookmarks