Spilt a date range into one row per day

liorchn

New Member
Joined
Jun 1, 2014
Messages
7
Hi there,

Can you please help me (I guess with a macro code) how to split a date range into one day per row.

Ive got an excel sheet with 30,000 rows which contains an absence leaves of the company employees (emp number, emp name, absence code, start date, end date).

I want that every row contain only one day and not a date range (I know that this will lead to the addition of many roes but i dont have a choise)

Thank you very much​
 
Hi please help me how to make VBA for this.

from a daily to consolidated weekly base on the days of operation.

it splits the row because there is no schedule on 21-oct-2015. may be the flight was cancelled.

ABCDEFGHIJKL
1DATA:
2Carrier IATA codeFlight numberDateDays of Operation numeric values (MTWTFSS) (1234567)DepartureDep TimeArrivalArr TimeSeatAcft code (IATA)Service Type
92XZ2072-Oct-155MNL1025SYD2015230388K
102XZ2075-Oct-151MNL1025SYD2015230388K
112XZ2077-Oct-153MNL1025SYD2015230388K
122XZ2079-Oct-155MNL1025SYD2015230388K
132XZ20712-Oct-151MNL1025SYD2015230388K
142XZ20714-Oct-153MNL1025SYD2015230388K
152XZ20716-Oct-155MNL1025SYD2015230388K
162XZ20719-Oct-151MNL1025SYD2015230388K
172XZ20723-Oct-155MNL1025SYD2015230388K
182XZ20726-Oct-151MNL1025SYD2015230388K
19RESULT
20Carrier IATA codeFlight numberEffective From DDMMMYYEffective To DDMMMYYDays of Operation numeric values (MTWTFSS) (1234567)DepartureDep TimeArrivalArr TimeSeatAcft code (IATA)Service Type
212XZ2072-Oct-1519-Oct-15135MNL1025SYD2015230388K
222XZ20723-Oct-1526-Oct-1515MNL1025SYD2015230388K

<colgroup><col width="64" span="13" style="width: 48pt;"></colgroup><tbody>
</tbody>


thanks

Without further guidance/information, I don't see how that could be done logically/consistently. For example, using your sample data for Flight number 207...

- Rows 23-24 below show your expected results.

- Rows 26-27 show a different set of results that seem to me to also fit the same original data.

Also, why does your first 207 result row use a start date of 1-Oct-15 when the first 207 flight is on 2-Oct-15?

Sheet2

*ABCDEFGHIJKL
1DATA:***********
2Carrier IATA codeFlight numberDateDays of Operation numeric values (MTWTFSS) (1234567)DepartureDep TimeArrivalArr TimeSeatAcft code (IATA)Service Type*
92XZ2072-Oct-155MNL1025SYD2015230388K*
102XZ2075-Oct-151MNL1025SYD2015230388K*
112XZ2077-Oct-153MNL1025SYD2015230388K*
122XZ2079-Oct-155MNL1025SYD2015230388K*
132XZ20712-Oct-151MNL1025SYD2015230388K*
142XZ20714-Oct-153MNL1025SYD2015230388K*
152XZ20716-Oct-155MNL1025SYD2015230388K*
162XZ20719-Oct-151MNL1025SYD2015230388K*
172XZ20723-Oct-155MNL1025SYD2015230388K*
182XZ20726-Oct-151MNL1025SYD2015230388K*
19RESULT***********
20Carrier IATA codeFlight numberEffective From DDMMMYYEffective To DDMMMYYDays of Operation numeric values (MTWTFSS) (1234567)DepartureDep TimeArrivalArr TimeSeatAcft code (IATA)Service Type
232XZ2071-Oct-1514-Oct-15135MNL1025SYD2015230388K
242XZ20716-Oct-1526-Oct-1515MNL1025SYD2015230388K
25************
262XZ2072-Oct-1519-Oct-15135MNL1025SYD2015230388K
272XZ20723-Oct-1526-Oct-1515MNL1025SYD2015230388K

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:69px;"><col style="width:80px;"><col style="width:110px;"><col style="width:170px;"><col style="width:125px;"><col style="width:75px;"><col style="width:57px;"><col style="width:51px;"><col style="width:52px;"><col style="width:67px;"><col style="width:65px;"><col style="width:58px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I'm sorry, but I am going to be away from the forum for an extended period so won't be able to help further with this anytime in the next few months.
 
Upvote 0
Hi Peter sorry for the confusion, what i want is a VBA that combines the daily into weekly depends on the date and day of the week.
let me correct the example below.

from the daily row it will combine those flights into single line as shown"row 21" but should be fall on the day of operation such 135.
from the daily data there is no flight on 21oct15 may be it was cancelled so. the single line with stop at 19 oct 15 as it fall on day 1
now it will insert another row (row 22) for the remaining flight which is 23oct that will fall on day 5 and 26oct will fall on day 1
now the multiple daily lines comes with 2 lines which is easy to read.

thanks peter

ABCDEFGHIJKL
1DATA:
2Carrier IATA codeFlight numberDateDays of Operation numeric values (MTWTFSS) (1234567)DepartureDep TimeArrivalArr TimeSeatAcft code (IATA)Service Type
92XZ2072-Oct-155MNL1025SYD2015230388K
102XZ2075-Oct-151MNL1025SYD2015230388K
112XZ2077-Oct-153MNL1025SYD2015230388K
122XZ2079-Oct-155MNL1025SYD2015230388K
132XZ20712-Oct-151MNL1025SYD2015230388K
142XZ20714-Oct-153MNL1025SYD2015230388K
152XZ20716-Oct-155MNL1025SYD2015230388K
162XZ20719-Oct-151MNL1025SYD2015230388K
172XZ20723-Oct-155MNL1025SYD2015230388K
182XZ20726-Oct-151MNL1025SYD2015230388K
19RESULT
20Carrier IATA codeFlight numberEffective From DDMMMYYEffective To DDMMMYYDays of Operation numeric values (MTWTFSS) (1234567)DepartureDep TimeArrivalArr TimeSeatAcft code (IATA)Service Type
212XZ2072-Oct-1519-Oct-15135MNL1025SYD2015230388K
222XZ20723-Oct-1526-Oct-1515MNL1025SYD2015230388K


<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,221,444
Messages
6,159,914
Members
451,603
Latest member
SWahl

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