View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
KDJ KDJ is offline
external usenet poster
 
Posts: 19
Default Inserting lines according to number of days, adjusting date

The code would be very much appreciated! I had offset and the counter in my
head but just can't put it together. I am too much of a novice.

The formatting is not a problem. I can solve that at the end by formatting
the report as a whole. Getting those lines in is where I am stuck.

Thank you!
KDJ

"Stopher" wrote:


KDJ wrote:
Hello

I am using Excel 2003.

I have a table showing meetings. This includes StartDate, EndDate,
Information (about the meeting) and Room. In most cases, the
StartDate=EndDate.

However, for those meetings that take more than one day, I need to have an
entry for each day so that a daily schedule of "what's on" can be printed.

I need to insert additional lines for the additional days, and copy the
information from the original entry into the new lines. I then have to change
the StartDate and EndDate for each day.

Example- if the meeting started on October 1 and finished October 3, the
original entry is:

StartDate EndDate Information Room
October 1 October 3 Bla bla bla 301

The new entries should be:
October 1 October 1 Bla bla bla 301
October 2 October 2 Bla bla bla 301
October 3 October 3 Bla bla bla 301

I have written the rest ... sorting by StartDate and grouping according to
this.

Any assistance for adding the lines, copying the data and changing the date
would be greatly appreciated!
--
Thanks very much. KDJ


Just right a sub that takes the end date and subtracts the startdate to
work out how many times it need to loop to insert the new rows. Take
the start date and add the counter to it to get the new start and end
date for fields 1 and 2 and then copy the room from the original cell.
I started to write the code and then couldn't rember the syntax for
offset and then realised you prob want date formatting etc.

Will write the code and test it and hopefully I'll post back before
someone else does, just a warning it might not look pretty.

Stopher