+ Reply to Thread
Results 1 to 6 of 6

How to remove rows based on filters and calculate sum of work time

  1. #1
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    How to remove rows based on filters and calculate sum of work time

    Hi everybody,
    I have provided an example excel sheet which is just for testing. I'll try to expand it to my real world problem (my real world problem has thousands of rows). I want to filter my row based on Type C and create a list which contains sum of work time for each date. I think I need to work with arrays in VBA. I'm weak in Arrays. I need your help to study the code.
    Please add some notes between your code and explain each step (I'm new to VBA)
    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: How to remove rows based on filters and calculate sum of work time

    How about using pivot table for this task? Will easily and quickly deal wit thousands of rows.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    Re: How to remove rows based on filters and calculate sum of work time

    Quote Originally Posted by Kaper View Post
    How about using pivot table for this task? Will easily and quickly deal wit thousands of rows.
    Can't VBA handle this to automate the process each time I update my file?
    I want to progress in VBA. Such challenges teach me lots of things about VBA programming.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: How to remove rows based on filters and calculate sum of work time

    Sample code:

    Please Login or Register  to view this content.

    PS. Don't quote whole post - everybody can see it, so it's just clattering. Sometimes selective quoting is useful, but whole post - almost never.

  5. #5
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    Re: How to remove rows based on filters and calculate sum of work time

    Ok, very nice code. Can we add personnel name to the left of each date cell?

  6. #6
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    Re: How to remove rows based on filters and calculate sum of work time

    What is dictionary? What does this mean? --> 'setup the dictionary (late binding, so no references needed)
    Set dict = CreateObject("Scripting.Dictionary")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calculate time based on 2 different rows for specific person/date
    By ricer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-21-2019, 10:30 AM
  2. [SOLVED] How to remove the seconds in a time format e.g. 22:30:21 - Left function does not work.
    By samvince in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2019, 11:31 AM
  3. Remove Un-Needed Rows Based on Time Entry Type
    By thomasjm99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2017, 03:38 PM
  4. Replies: 1
    Last Post: 06-10-2016, 11:38 PM
  5. Replies: 9
    Last Post: 07-13-2014, 11:09 PM
  6. time:how to work out how to calculate my finish time
    By Crasher in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-15-2006, 04:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1