Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
add
Dim x As Integer x = InputBox("enter number") Cells.Select Selection.FormatConditions.Delete Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _ "=NOW()-$P1<" & x With Selection.FormatConditions(1).Interior .ColorIndex = 37 .Pattern = xlSolid End With or Dim x As Integer, rw As Long, col As Long rw = Selection.Row col = Selection.Column x = WorksheetFunction.Count(Range(Cells(rw, 1), Cells(rw, col))) -- steveB Remove "AYN" from email to respond "Al Franz" wrote in message ... Steve, Thanks a lot, I took your advice and recorded a macro. The following is what the code looked like. Is there an easy way to make the value of "8" I coded in below a variable, so when I run the macro Excel would prompt me for a value (i.e. number of days back to highlight)? Cells.Select Selection.FormatConditions.Delete Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _ "=NOW()-$P1<8" With Selection.FormatConditions(1).Interior .ColorIndex = 37 .Pattern = xlSolid End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check if date is between two dates, then sum only those rows | Excel Worksheet Functions | |||
formula to check the date sequence in rows | Excel Discussion (Misc queries) | |||
Hightlight date range | New Users to Excel | |||
format column to automatically move rows to date order | Excel Worksheet Functions | |||
... Can I set Spell Check to automatically check my spelling ... | Setting up and Configuration of Excel |