+ Reply to Thread
Results 1 to 9 of 9

Auto Populating Cells From A Date Range

  1. #1
    Registered User
    Join Date
    08-26-2011
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    6

    Auto Populating Cells From A Date Range

    Hi guy,

    Need your help on following..

    Basically i am trying to auto populate cells "with a macro" using two dates as the parameters, for example

    A2 - Start Date - JAN -01-2000 ; which are inbetween Jan 2000 to DEC 2020
    B2 - End Date - DEC - 31-2001 : which are in between Jan 2000 to DEC 2020
    C2 - Monthly value - 99 : column C contains the value which will populated automatically under correct months
    D2- Jan 00
    E2 - Feb 00
    F2 - Mar 00....and this carries on across till Dec 20.

    What i am wanting excel to do(with macro) is to be able to populates a fixed figure "99" which is in C2 across in to the correct months, in this example.. D2 "Jan 00" to AA2 "DEC 01" .

    please help on this.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Auto Populating Cells From A Date Range

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Auto Populating Cells From A Date Range

    hi, vuyyuru, will that be of any help?
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    08-26-2011
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Auto Populating Cells From A Date Range

    Quote Originally Posted by Bob Phillips View Post
    Please Login or Register  to view this content.
    Hi Bob,

    Thanks for your help. your macro almost helps. the only change i need is ..

    the columns are fixed, that means column-D is for Jan-00, E is for Feb-00 , F is for MAR-00.......
    for example if start date is Jan -01 -2000 (A2 value) and end date is DEC- 31-2000 (b2 value) the value of column C2 will populate in column D2 to O2.

    if start date is Jan -01 -2001 (A2 value) and end date is NOV- 30-2001 (b2 value) the value of column C2 will populate in column P2 to Z2.

    please help on this.

  5. #5
    Registered User
    Join Date
    08-26-2011
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Auto Populating Cells From A Date Range

    Quote Originally Posted by watersev View Post
    hi, vuyyuru, will that be of any help?
    wow! your formula is good. but why if not populating the value under the month MAR-00? for the date rage (Jan-01-2000 to DEC-31-2001). please check on this and the column headings need to present in row 1 insted of row2. i changed your fomula from "=IF(AND(A2>=$D$2,D2<=$B$2),$C$2,"")" TO "=IF(AND(A2>=$D$1,D1<=$B$2),$C$2,"") " .. It's not working ? i'm not sure what mistake i done?

  6. #6
    Registered User
    Join Date
    08-26-2011
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Auto Populating Cells From A Date Range

    Quote Originally Posted by vuyyuru View Post
    wow! your formula is good. but why if not populating the value under the month MAR-00? for the date rage (Jan-01-2000 to DEC-31-2001). please check on this and the column headings need to present in row 1 insted of row2. i changed your fomula from "=IF(AND(A2>=$D$2,D2<=$B$2),$C$2,"")" TO "=IF(AND(A2>=$D$1,D1<=$B$2),$C$2,"") " .. It's not working ? i'm not sure what mistake i done?
    Hi, thanks.. i'm able to correct the formula, i changed to =IF(AND(D1>=$A$2,D1<=$B$2),$C$2,"") .. it's working fine. thanks for the help. i mainly looking for a macro solution, i will wait for Bob or other reply. thanks for you support too. i learned a new thing from you today.

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Auto Populating Cells From A Date Range

    Is this what you mean

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-26-2011
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Auto Populating Cells From A Date Range

    Quote Originally Posted by Bob Phillips View Post
    Is this what you mean

    Please Login or Register  to view this content.
    Perfect.. this is what I’m looking for. Super Bob!. Thank you very much.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Auto Populating Cells From A Date Range

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this

    Crosspost: http://www.vbaexpress.com/forum/showthread.php?t=38829
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1