Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Divide sheets among diferent people

$
0
0

So i have multiple sheets with information on them. i need to divide these sheets evenly among multiple people. But i need to divide it by the length of the list. For Example: Sheet 1 has 15 Rows Sheet 2 has 41 Rows Sheet 3 has 32 Rows

Totals Rows is 88 if i have 5 people that would be 17.6 per person. round to the integer would be 17 per person. so what i'm looking for it to do is divide by sheet and row. Example: Person 1 would get Sheet 1 Rows 1-15 and Sheet 2 Rows 1 and 2 Person 2 would get Sheet 2 Rows 3-20 etc...

here is what i have so far.

Staff = InputBox("How many people will this be divided among?", "Split")
ReDim Person(1 To Staff)
ReDim SNarray(1 To Sheets.Count)
For i = 1 To Sheets.Count
    SNarray(i) = Sheets(i).Name
Next
ReDim RowCounts(1 To Sheets.Count)
For i = 1 To Sheets.Count
    Sheets(SNarray(i)).Activate
    RowCounts(i) = Cells(Rows.Count, 1).End(xlUp).Row
Next
For i = 1 To Sheets.Count
    Total = Total + RowCounts(i)
Next
Total = (Total - 2) / Staff
Total = Int(Total)

Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>