Hi All,
I have a sheet that is used to track a user's tasks/cases done during a day. Sort of a time tracking tool. The users are working on cases so each row has data on that specific case. The feature I am trying to incorporate in it is to automatically sort data when a particular amount of data has been added to the sheet. I have tried the example given by Allan Wyatt on this link - https://excel.tips.net/T009005_Automatically_Sorting_as_You_Enter_Information.html
here's the macro:
But the above code sorts data as soon as I have entered anything in the first column. It would be good if it waited till a few more subsequent fields are populated before sorting.
Now what I am working to get is a more advanced version of this macro. That would include the following:
1) Auto sort data only after a certain fields of each row is completed. To put that in perspective, column 1 has the name of the task/case, column 2 the type of activity, column 3 the date the task is being done...... until column 8 that calculates the total time used on that task/case. But the macro can carry out the auto sort soon after there's data in the column 4.
2) Scroll the user's view of the sheet over to where the row would have moved in the sheet.
3) Select the next cell in that row.
Other suggestions needed are:
1) How can we ensure that the user always enters data in the next empty row only. And not randomly anywhere in the sheet. Should a userform be used everytime a new Task/Case details have to be entered in the sheet?
2) Is there a way to group the times of the same Case/Task so one can see how long a task or case took in the end to be completed? (Note: tasks/ cases can sometimes go on for a few weeks or even months so totalling the time spent on each and every specific task).
Thank you.
I have a sheet that is used to track a user's tasks/cases done during a day. Sort of a time tracking tool. The users are working on cases so each row has data on that specific case. The feature I am trying to incorporate in it is to automatically sort data when a particular amount of data has been added to the sheet. I have tried the example given by Allan Wyatt on this link - https://excel.tips.net/T009005_Automatically_Sorting_as_You_Enter_Information.html
here's the macro:
Code:
Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next
If Not Intersect(Target, Range("B:E")) Is Nothing Then
Range("B2:E2").Sort Key1:=Range("B3:E3"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub
But the above code sorts data as soon as I have entered anything in the first column. It would be good if it waited till a few more subsequent fields are populated before sorting.
Now what I am working to get is a more advanced version of this macro. That would include the following:
1) Auto sort data only after a certain fields of each row is completed. To put that in perspective, column 1 has the name of the task/case, column 2 the type of activity, column 3 the date the task is being done...... until column 8 that calculates the total time used on that task/case. But the macro can carry out the auto sort soon after there's data in the column 4.
2) Scroll the user's view of the sheet over to where the row would have moved in the sheet.
3) Select the next cell in that row.
Other suggestions needed are:
1) How can we ensure that the user always enters data in the next empty row only. And not randomly anywhere in the sheet. Should a userform be used everytime a new Task/Case details have to be entered in the sheet?
2) Is there a way to group the times of the same Case/Task so one can see how long a task or case took in the end to be completed? (Note: tasks/ cases can sometimes go on for a few weeks or even months so totalling the time spent on each and every specific task).
Thank you.
Last edited: