Create records

James Tebb

New Member
Joined
Nov 12, 2009
Messages
26
In Table One there are 2 fields - Start Date and End Date.
In Table Two I have 2 fields - Date and Event

I want to create a macro that looks at the start date and end date in table 1 and creates new records in table 2 - one for each date between start and end.


Does this make sense??
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
James

This might sound like a stupid question, why?

Isn't it possible you could end up with a whole load of redundant fields with just a date and nothing else?

Or do you have data for the Event field for each date?
 
Upvote 0
I have data for each event that will need to be put in manualy. I just want to speed up the job by populating the table with the dates automatically.
 
Upvote 0
James

Why not set up a form so that when the user adds a new record the date is taken from the previous record, or latest date?

By the way, where do you have this data?
 
Upvote 0
Apologies my knowledge is poor
Thats exactly what I want to do. but how do I get it to recognise the previous date and return a new rcord with date + 1
 
Upvote 0
Will the previous date just really be the maximum/latest date in that field?

If it is then you should be able to use DMax() to get the latest date and add 1 to get the next date in sequence.

You won't be able to do that in the table, you would need to use a form, and you might need a little bit of code.

PS I do mean a little bit - one line in the right place should do it.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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