Hi. I've tried my best to make my own code.
My aim is to highlight the cells in the other sheets based on the dates in D20, E21 and E20.
Here's what I tried by recording what I wanted to do. Unfortunately, it isn't able to highlight the cells that I want to be highlighted. The code works only to make the dates into the format that I want but it isn't able to copy and paste to the conditional formatting and do the highlighting. May I know what I can do to the code to highlight the cells containing the dates in D20, E21, and E20?
D20 = contains the date today in ddmmmyy
E20 = contains the next working date in ddmmmyyy
E21 = contains the date today in ddmmmyyyy
Cells with date today (D20 and E21) should be in yellow
Cells with next working date (E20) should be in blue
Appreciate any help please. Thanks.
Sub BondsTemplateAM()
'
' BondsTemplateAM Macro
'
'
Range("C17:C18").Select
Selection.Copy
Range("D20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C17").Select
Application.CutCopyMode = False
Selection.Copy
Range("D20:D21").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("D20").Select
Selection.NumberFormat = "ddmmmyy"
Range("D21").Select
Selection.NumberFormat = "ddmmmyy"
Range("D20").Select
Selection.Copy
Range("E20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("D20").Select
Application.CutCopyMode = False
Selection.Copy
Range("E20").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "ddmmmyyyy"
Range("D20").Select
Selection.Copy
Sheets("MM444R1").Select
Columns("A:A").Select
Application.CutCopyMode = False
Sheets("list").Select
Range("D21").Select
Selection.Copy
Sheets("MM444R1").Select
Application.CutCopyMode = False
Sheets("list").Select
Range("D20").Select
Selection.Copy
Sheets("MM446R1").Select
Columns("A:A").Select
Application.CutCopyMode = False
Sheets("list").Select
Range("D21").Select
Selection.Copy
Sheets("MM446R1").Select
Application.CutCopyMode = False
Sheets("list").Select
Range("E20").Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
Sheets("MP446R1 ").Select
Columns("A:A").Select
Application.CutCopyMode = False
ActiveWindow.ScrollWorkbookTabs Sheets:=-5
End Sub
Display More