If anyone can help I have received a program from someone that is not working correctly.Unfortunately they are not currently available to correct this.and the program is way above my knowledge.
As briefly as possible I will go through it. From the main tab select analyse, as it stands this will select the file in sistrace2, select check/uncheck all then analyse selected users and then select all users. This will produce an interactive sheet then click export, this will produce a summary spreadsheet in the user actions tab.
The problem is although the numbers in the spreadsheet appear to be correct for each user what it is not doing is selecting the "shift" correctly for each user. It should extract this info from lines 76-256 in the main tab. We should be able to manually inport into this area,
What the spreadsheet should currently be producing is all users as "AM" bar one as "NIGHTS".and no "UNDEFINED"
I hope the code below is where the problem is but my knowledge is very limited and so I have no faith it is and so I have put an unprotected version of the full macro in the spreadsheet in the zip.file attached.
If anyone can find the solution it would be very much appreciated if you could post the code altered a) to increase my knowledge and b) so I can tell the creator what has changed when they are available again
If NSheetName = "" Then
Call PreCloseRoutine
End
End If
'### name is now stored in NSheetName. If NSheetName="" then execution has already halted
Call ReadDataIntoArray(NSheetName, arrImportData, ThisWorkbook.Name)
'### got data, now make to sense of it all
'### need to populate the list box for users first... get unique entries in range and then find early and latest times for activity
'### USERS
Call UniqueItems(arrImportData, arrUsers, 1)
Call UniqueItems(arrImportData, arrUniqueShifts, 19)
ReDim arrGroupCounters(50, UBound(arrUniqueShifts) + 1) '1= ALL USERS, 2=AM SHIFT, 3 = PM SHIFT, 4 = NIGHTS
'### TIMES
i = 2
arrGroupCounters(50, 1) = "ALL USERS"
For count = LBound(arrUniqueShifts) To UBound(arrUniqueShifts)
arrGroupCounters(50, i) = arrUniqueShifts(count)
i = i + 1
Next
ReDim arrUsersTimes(10, UBound(arrUsers) + UBound(arrUniqueShifts) + 1) '1= USER, 2 = START, 3 = FINISH, 4 = SHIFT, 5 = "A" (All), [6 - 10 = undefined] +4 = ALL USERS, AM, PM, NIGHTS SUMMARY
'### ALL
arrGroupCounters(42, 1) = -1
arrGroupCounters(43, 1) = -1
'### SHIFT
For i = LBound(arrGroupCounters, 2) To UBound(arrGroupCounters, 2)
arrGroupCounters(2, i) = -1
arrGroupCounters(4, i) = -1
Next
Bookmarks