SOLVED

Help with timesheet created by MS Forms

Occasional Contributor

Hi Folks, new to this forum so please be gentle

 

I have 8 employees who use a mS Form I have created to input their weekly timesheet. At the end of the week, I save the results to an excel file. All the entries are in random order and each employee can have various amounts of entries. I use a macro to sort the entries into day order (Monday, Tuesday, etc.) and the sort them into employee order alphabetically.  They input hours for each entry and I can total the hours for the whole sheet. This works reasonably well and it produces a PDF that we save for each week. What I would like to do, is be able to insert a row after each employee and total their individual hours for the week within that row. Any help with how to do this would be appreciated.

10 Replies

@BillZab 

Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

@Hans Vogelaar Please see above. This is what I get from the form after I remove the columns I dont need and sort the order of the day of the week and then the employees. The number of rows can vary from week to week. What I am looking for is a way to add up the hours of each employees. Ideally I would insert a row between each employee the total the hours for each employee. It needs to be done in a macro. TIA.

 

 

@BillZab 

What do you mean by "Please see above"?

Sorry @Hans Vogelaar I thought I had attached a screenshot. I will try again tomorrow when I have more time.

Sheet.jpg

Sorry about the problem getting the photo of the sheet to attach.
What I am trying to do, is insert a row between Joe and Dave, then total Joe's hours and so on. I can do this manually easy enough, but I need it done in a macro. The row count will vary from week to week. Again, any help will be appreciated. TIA
best response confirmed by Sergei Baklan (MVP)
Solution

@BillZab 

You can use Excel's Subtotal feature.

Click anywhere in the data.

Activate the Data tab of the ribbon and click Subtotal in the Outline group:

S2275.png

The Subtotal should propose to add a subtotal for each change in the NAME column, and add it to the HOURS column:

S2276.png

Click OK. Result (with some random dummy data):

S2277.png

Many thanks @Hans Vogelaar. That has worked perfectly. I had a few issues as the SubTotal option was grayed out, but found a solution on the web. Thanks again for your help.

@BillZab 

Select the HOURS column.

On the Data tab of the ribbon, click Text to Columns, then click Finish without changing any settings.

Does that make Subtotal available?

That's it working perfectly Hans. Many thanks.