JayhawkRacer
New Member
- Joined
- Feb 24, 2014
- Messages
- 4
I apologize if this is simple or has been asked. I couldn't find the answer from an extensive search here and other communities.
I'm attempting to use VBA to edit column 12 in each row that meets the following criteria:
Column 16 is a specific text string ("name")
Column 11 is a specific text string ("RESCHED IN")
Column 12 is tomorrow, today, or in the past (anything after tomorrow should remain unedited)
Here's the code I'm trying so far, but obviously the "date+1" is a terrible idea and doesn't work. Any ideas?
The
part works, but it completely ignores any of my date criteria and just makes column 12 Today+2 days for anything that meets the "name" and "RESCHED IN" criteria.
I'm attempting to use VBA to edit column 12 in each row that meets the following criteria:
Column 16 is a specific text string ("name")
Column 11 is a specific text string ("RESCHED IN")
Column 12 is tomorrow, today, or in the past (anything after tomorrow should remain unedited)
Here's the code I'm trying so far, but obviously the "date+1" is a terrible idea and doesn't work. Any ideas?
Code:
LastRow = Range("C65536").End(xlUp).Row
For c = LastRow To 2 Step -1
If Cells(c, 16) = "name" And Cells(c, 11) = "RESCHED IN" And (Cells(c, 12) < "Date" Or Cells(c, 12) = "Date" Or Cells(c, 12) = "Date+1") Then
Cells(c, 12).FormulaR1C1 = "=Today()+2"
End If
Next c
The
Code:
Cells(c, 12).FormulaR1C1 = "=Today()+2"
Last edited: