Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 12-02-2019, 10:26 AM
NoSparks NoSparks is offline Automatically update user-inputted date after specified time range Windows 7 64bit Automatically update user-inputted date after specified time range Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Try changing the macro to this
Code:
Sub UpdateIntakeDate()
    Dim rng As Range, cel As Range, lr As Long
With Sheets("Sheet1")
    lr = .Cells(.Rows.Count, "G").End(xlUp).Row
    If lr < 5 Then Exit Sub
    Set rng = .Range("G5:G" & lr)
    For Each cel In rng
        If cel <> "" Then
            If Date >= DateAdd("yyyy", 1, cel) Then
                cel = DateAdd("yyyy", 1, cel)
            End If
        End If
    Next cel
End With
End Sub

Last edited by NoSparks; 12-02-2019 at 10:45 AM. Reason: changed lr to < 5
Reply With Quote
 

Tags
automatically, update, year



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically update user-inputted date after specified time range Auto update excel graph range, ignore data when date reads 00-Month-00 SavGDK Excel 2 06-24-2016 08:05 AM
Automatically update user-inputted date after specified time range Auto populating dates on timesheet for week from one inputted date ohi Word VBA 3 12-04-2014 12:11 PM
Date/Time Formula for Entry level XL user talon1driver Excel 2 09-18-2014 02:32 PM
Mail merge with filter using data inputted by user Tornado70 Mail Merge 6 04-09-2013 07:16 AM
Automatically update user-inputted date after specified time range How to update automatically the “file name” as we do for the “Date”? Jamal NUMAN Word 2 01-06-2011 02:43 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft