I have a spreadsheet where attendance data is entered on the tab labeled "Input - Meeting Attendance" and, when someone clicks on the tab labeled "Output - Reports", the attendance data is copied from the tab labeled "Input - Meeting Attendance" to the tab labeled "Output - Reports" and then sorted in a useful manner. I noticed that, when the attendance data is entered, some people leave blank lines that would carry forward to the final, sorted report, so I added a sort operation just to remove the blank lines before another sort operation would organize the attendance data in a useful manner.
The first sort operation is in userform1 and works great if I have a fairly long list of attendees, but if the list is fairly short, then the sort operation doesn't work and I get the error message:
Untitled.png
and the debugger highlights the step shown in the following image:
Code.JPG
If I copy the attendee list and paste it into the "Input - Meeting Attendance" tab after the existing data (so I double the length of the list of meeting attendees), then the sort operation (and the entire spreadsheet) works properly.
The question is: Why does the sort operation fail for a short list and what can I do to make the sort operation work for any length list of meeting attendees?
The spreadsheet is attached to this post.
Bookmarks