+ Reply to Thread
Results 1 to 2 of 2

Using the 'Date' function and VBA

  1. #1
    Registered User
    Join Date
    05-05-2009
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Using the 'Date' function and VBA

    I have some data that has dates (month and year) associated with it. I currently do the following: sort the dates and find the first date and the last date in the range. I now need to populate a list containing every month and year combination between those two dates. For instance, if the date range was Jan 2008 to Apr 2008, I need to create a list with: Jan, Feb, Mar, and Apr 2008.

    In Excel, I use the Date function to add 1 to the month value of each date, which works great. I would like to use this function from my VBA code using somethling like the following:
    Please Login or Register  to view this content.
    The code above (I think) should populate Cell(1,6) with Jan-1-2008. My question is not about how to use the WorksheetFunction capability, rather how to use the "date" method from VBA code, since I get the following error: "Object doesn't support property or method" when I run the above code.
    Last edited by gtmeloney; 05-18-2009 at 01:18 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using the 'Date' function and VBA

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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