Searching and Replacing Dates
Closed
FranBacAero
Posts
1
Registration date
Tuesday 9 August 2016
Status
Member
Last seen
9 August 2016
-
9 Aug 2016 à 14:43
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 11 Aug 2016 à 12:05
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 11 Aug 2016 à 12:05
Related:
- Searching and Replacing Dates
- Vivatech 2024 dates - Guide
- Iphone 14 release dates - Home - IOS
- Spybot search and destroy - Download - Antivirus
- Blackhat dates - Guide
- Searching in vim - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
11 Aug 2016 à 12:05
11 Aug 2016 à 12:05
Hi FranBacAero,
Assuming the dates are located in one column, try this (after changing the 3 A's on the 2nd code line to the column letter referring to your date column):
In case you don't know:
How to implement and run a code:
- From Excel hit Alt + F11 to open the “Microsoft Visual Basic” window.
- Go to the top menu in the newly opened window > Insert > Module.
- Paste the code in the big white field.
- You can now close this window.
- Back at Excel, hit Alt + F8 to display the available macro’s.
- Double-click the macro you wish to run.
NOTE: macro’s cannot be reversed using the blue arrows. Always make sure you save your file before running a code, so you can re-open your file if something unforeseen happens or you want to go back to the situation before the code was run.
Best regards,
Trowa
Assuming the dates are located in one column, try this (after changing the 3 A's on the 2nd code line to the column letter referring to your date column):
Sub RunMe()
For Each cell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
If cell.Value <> vbNullString And cell.Value < Now Then
cell.Value = Format(Now, "m-d-yy")
End If
Next cell
End Sub
In case you don't know:
How to implement and run a code:
- From Excel hit Alt + F11 to open the “Microsoft Visual Basic” window.
- Go to the top menu in the newly opened window > Insert > Module.
- Paste the code in the big white field.
- You can now close this window.
- Back at Excel, hit Alt + F8 to display the available macro’s.
- Double-click the macro you wish to run.
NOTE: macro’s cannot be reversed using the blue arrows. Always make sure you save your file before running a code, so you can re-open your file if something unforeseen happens or you want to go back to the situation before the code was run.
Best regards,
Trowa