Results 1 to 3 of 3

Automatic Year Change in VBA

Threaded View

  1. #1
    Forum Contributor dogberry's Avatar
    Join Date
    07-15-2012
    Location
    Wales, UK
    MS-Off Ver
    Excel 2010
    Posts
    624

    Automatic Year Change in VBA

    Hi


    Sub MayMonth()
    '
    ' MayMonth Macro
    '
    
    '
        Range("A5").Select
        ActiveCell.FormulaR1C1 = "1-May-2013"
        Range("A5").Select
        Selection.AutoFill Destination:=Range("A5:A35"), Type:=xlFillDefault
        Range("A5:A35").Select
    End Sub

    With the above code I have twelve of them one for each month April 2013 to March 2014. Can I get the year to change automatically for 2014 to 2015 or do I have to edit each year manually and resave. Or is there a better way.

    Many thanks

    Chris
    Last edited by Cutter; 10-28-2012 at 12:40 PM. Reason: Corrected code tags
    Click my star if I helped Thanks

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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