title: How to calculate the time difference using VBA?
body: <p>I am a beginner in VBA. I need solution to my problem only in VBA. Thanks.</p>
  
  <p>Following are the tasks that I am required to do</p>
  
  <ol>
  <li><p>Select a 'ID' and a 'Course' from the table. In the table below I have mentioned few IDs and Courses, however my project has multiple ID's and Courses. I cannot keep entering the ID and course name for all the cases. Is there a smart way to do this? </p></li>
  <li><p>For a specific ID, Specific course and specific Date, I need to calculate the time difference between two rows as given in below table for specific 'Event'. The time difference first two rows give the time spent on 'Reading', the difference between row 2 and 3 give the time spent on 'Writing', the difference between row 3 and 4 give the time spent on 'Writing', and so on.</p></li>
  </ol>
  
  <p>Any help will be highly appreciated. <strong>The data format is in the link below</strong></p>
  
  <p><a href="https://i.stack.imgur.com/kmUmy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kmUmy.png" alt="enter image description here"></a></p>