Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JBP JBP is offline
external usenet poster
 
Posts: 2
Default total populate date

Hello All

My question is

I have a number of records with different start and end dates some start dates are in 03 and others are in 04 but I have a a figure eg. 1250 that needs to be populated throughout the months in 04

Start Date End Date Duration Total Jan Feb Mar Apr May Jun Jul ....Dec (all 04
02/01/03 02/01/04 2mths 04 1250 1250 1205
05/04/04 06/05/04 1mth 04 100 10

How do I get this to automatically populate the field without doing it manually. There are hundreds of records

Thank

JB

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default total populate date

You have ambigous dates. Are your dates mm/dd/yy or dd/mm/yy.

Why does the second data row not have 1250 placed in it. ( 05/04/04
06/05/04 )

No matter what your date order, 05/04/04 06/05/04 touches two
months - What determines where the value goes in a situation like this.
First month, second month, both months? What are the rules?

In the first data row, you probably show Feb 1, 2004 as the end date, then
count that as 2 months in 04 and put in values in both Jan and Feb. In the
second data row, it is probably from May 4, 2004 to Jun 5, 2004 - but you
show 100 in March 2004. Again, what are the rules?


--
Regards,
Tom Ogilvy

"JBP" wrote in message
...
Hello All,

My question is:

I have a number of records with different start and end dates some start

dates are in 03 and others are in 04 but I have a a figure eg. 1250 that
needs to be populated throughout the months in 04

Start Date End Date Duration Total Jan Feb Mar Apr May

Jun Jul ....Dec (all 04)
02/01/03 02/01/04 2mths 04 1250 1250 1205
05/04/04 06/05/04 1mth 04 100 100


How do I get this to automatically populate the field without doing it

manually. There are hundreds of records.

Thanks

JBP



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default total populate date

JBP,

Does this do it


Sub PopulateFields()
Dim cLastRow As Long
Dim i As Long
Dim j As Long

For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
For j = 5 To 16
If (Cells(i, "A").Value <= Cells(1, j).Value And _
Cells(i, "B").Value = Cells(1, j).Value) Then
Cells(i, j).Value = Cells(i, "D").Value
End If
Next j
Next i

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JBP" wrote in message
...
Hello All,

My question is:

I have a number of records with different start and end dates some start

dates are in 03 and others are in 04 but I have a a figure eg. 1250 that
needs to be populated throughout the months in 04

Start Date End Date Duration Total Jan Feb Mar Apr May

Jun Jul ....Dec (all 04)
02/01/03 02/01/04 2mths 04 1250 1250 1205
05/04/04 06/05/04 1mth 04 100 100


How do I get this to automatically populate the field without doing it

manually. There are hundreds of records.

Thanks

JBP



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to lookup date on tab in excel and populate date on calen MGC Excel Worksheet Functions 0 February 4th 10 04:48 AM
Picking a Date to Populate a Cell Jim Farren Excel Discussion (Misc queries) 3 March 19th 08 06:19 PM
how do you auto populate the date in excel? ccb/ws New Users to Excel 2 June 13th 06 07:46 PM
Earliest Date to populate? sonquizzon Excel Worksheet Functions 2 June 16th 05 07:35 PM
Formatting a cell to populate on a certain date Brian Excel Worksheet Functions 6 February 16th 05 02:10 AM


All times are GMT +1. The time now is 01:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"