Hi,
Can someone please help me edit an existing macro? Need 3 changes –
1) The macro creates a new workbook and also copies the hidden rows from the original file. I don’t need the hidden rows on the new workbook
2) On the new workbook sheet1, sheet2 & sheet3 are blank and need to be deleted.
3) On the new workbook “decision date” column any date before today’s date should be highlighted in red and anything = > today’s date should be highlighted in orange
Hope someone can help me out with this please!!!
Have attached sample data and vba code pasted below –
Option Explicit
Dim FName As String
Dim SName As String
Dim lrow As Long
Dim i As Long
Sub filter_rows()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Workbooks.Add
ActiveWorkbook.SaveAs ("Output File")
FName = ActiveWorkbook.Name
With ThisWorkbook.Worksheets("Pipeline (Current wk)")
lrow = .Range("A" & .Rows.Count).End(xlUp).Row
For i = 15 To lrow
If .Range("U" & i).Value <= Date + 7 Then
SName = .Range("X" & i).Value
If Not Evaluate("ISREF('" & SName & "'!A1)") Then
Workbooks(FName).Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = SName
.Rows("14:14").Copy Workbooks(FName).Worksheets(SName).Range("A1")
End If
.Rows(i & ":" & i).Copy Workbooks(FName).Worksheets(SName).Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End If
Next i
End With
With Workbooks(FName)
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Bookmarks