Split my data up into individual days using a start and end time and going into the next day if needed

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,
I download our sales from the system in a big list of up to 14 days
I want a macro that will give me each day's figures in their own area,
I have a sheet Called days that I've set up the headers for each of the 14 days.

I want to put a start date end date, start time, end time into cells run a macro and it splits the data up for me,
however, because we are a 24-hour business I might want to start time to be 7pm and the end time be 3am effectively going into the next day.

So to Elaborate this is what I'm looking for

I have a sheet named raw which holds all the downloaded data, row 1 is the headers.
the columns to copy are A to Y

In AB7 I have start date
AB8 end date
Ab10 start time
AB11 end time

So I need the macro to be smart enough to realise that sometimes the end time is the next day.

but all I want is for the macro to go right, day one is "Start day/ Start time, until start day/end time", (if end time is after 23:59 the its Start day +1 /end time)
then copy that data into sheet "Day" A2 paste values, then go right, next day is Start day+1/ Start time, until start day+1/end time, (if end time is after 23:59 the its Start day +2 /end time)
copy and paste into "Day" AA2 paste values and so on for each day chosen.

Please help if you can.
Thanks
Tony
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top