Hi
We have a piece of software that outputs an Excel file once a week, this file has to be organised and edited to show specific information, which is quite a tedious task!
I am trying to produce a macro that will do everything for me, and have almost got everything figured out except the last little bit.
I need it to highlight all rows that have a date before today in column E
This bit of code i have been trying sort of works:
It has two small problems though, firstly it only highlights the rows prior to today for this month, anything last month or previous it doesn't seem to work for. This is a bit odd and i don't really understand why it would do this.
Secondly, it highlights the row of the whole workbook, i really want it to only highlight the row in the table. (Columns A to T if that helps)
Anyone able to help?
Ta muchly
We have a piece of software that outputs an Excel file once a week, this file has to be organised and edited to show specific information, which is quite a tedious task!
I am trying to produce a macro that will do everything for me, and have almost got everything figured out except the last little bit.
I need it to highlight all rows that have a date before today in column E
This bit of code i have been trying sort of works:
VBA Code:
Dim TDateM As String
TDateM = Date
endrow = Range("E" & Rows.Count).End(xlUp).Row
For Each cell In Range("E2:E" & endrow)
If cell.Value < TDateM Then
cell.EntireRow.Interior.ColorIndex = 6
End If
Next
It has two small problems though, firstly it only highlights the rows prior to today for this month, anything last month or previous it doesn't seem to work for. This is a bit odd and i don't really understand why it would do this.
Secondly, it highlights the row of the whole workbook, i really want it to only highlight the row in the table. (Columns A to T if that helps)
Anyone able to help?
Ta muchly