EdwardToet
New Member
- Joined
- Dec 30, 2010
- Messages
- 4
Good evening all (It's that time of day where I struggle with VBA),
I have a problem that has been discussed a number of times, also on this forum, but I cannot get things to work. I need my project to sort the data on each worksheet by date automatically when I leave the sheet. If the data is not sorted in this way, the summary sheet does not add up the figures correctly. After consulting various forums on the subject, including this one, I came up with the code for:
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
followed by the sorting instruction.
This works, but not on leaving the sheet. The sorting is only done when I re-enter the sheet, thus requiring extra keystrokes. Does anybody have any idea what I may be doing wrong. I regret that I am unable to give more information as I do not (yet) know how to squeeze more words into the restricted space of this input form.
I have a problem that has been discussed a number of times, also on this forum, but I cannot get things to work. I need my project to sort the data on each worksheet by date automatically when I leave the sheet. If the data is not sorted in this way, the summary sheet does not add up the figures correctly. After consulting various forums on the subject, including this one, I came up with the code for:
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
followed by the sorting instruction.
This works, but not on leaving the sheet. The sorting is only done when I re-enter the sheet, thus requiring extra keystrokes. Does anybody have any idea what I may be doing wrong. I regret that I am unable to give more information as I do not (yet) know how to squeeze more words into the restricted space of this input form.