+ Reply to Thread
Results 1 to 5 of 5

Add the last year to my loop

  1. #1
    Registered User
    Join Date
    06-03-2014
    MS-Off Ver
    2007
    Posts
    87

    Add the last year to my loop

    Good morning,

    I'm trying to find a way so that when new data is available for 2015, I won't have the rewrite the code. Is there a way to do something like :

    If rg.value= "abc"& Actual year Then

    Please Login or Register  to view this content.
    Thank you
    Last edited by SIMBAtheCAT; 07-10-2014 at 10:38 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Add the last year to my loop

    You can use Year(Date) to get the current year.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Add the last year to my loop

    Accidental dupe.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Add the last year to my loop

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-03-2014
    MS-Off Ver
    2007
    Posts
    87

    Re: Add the last year to my loop

    "" & Year(Date) is perfect!

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  2. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  3. Convert a multiple year list of 365 days/year into an equivalent of 360 days/year
    By lobotomy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2012, 05:39 PM
  4. picking up fiscal year in a for loop, vba. Excel
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2012, 04:45 AM
  5. Loop using Month() and Year()
    By AMansell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2006, 07:48 PM

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