Log in

View Full Version : Reorganise table using VBA



mobidv
03-14-2013, 06:10 AM
Hi all,

Hope somebody can help :hi:

I currently have a table in access that is laid out like this:

Name (Contains a name)
Start of Week (eg 10/03/2013)
Sun (eg 10:00 - 19:00)
Mon (eg 10:00 - 19:00)
Tues (eg 10:00 - 19:00)
Weds (eg 10:00 - 19:00)
Thurs (eg 10:00 - 19:00)
Fri (eg 10:00 - 19:00)

I am looking for a way to create a new table using that data but in a different format like this:

Name (Contains a name)
Date (10/03/2013)
Start (10:00)
End (19:00)

As you can see, unlike the first table that has one row per person per week, this new table will have a row per person per day. The days need to be calculated using the start of week date in the original table.

I know this is really complicated but thought it was worth seeing if any of you guys could help.

A spreadsheet with both table formats is attached.

Kind Regards,

mohanvijay
03-14-2013, 06:23 AM
you can do this by loop through original table records