I cannot attach a workbook as it would be sensitive company info. I need a macro that will do the samw thing that conditional formatting does for all the sheets.
Posts by grace_g
-
-
Requesting to delete this thread please.
-
Because there are many sheets and it's time consuming to do it manually via conditional formatting for each sheet.
-
The finished product should look like the one attached here. I can do it using conditional formatting but it's time consuming because I have to do it for the other sheets too
-
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.
Code
Display MoreSub 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