LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Automatically Hightlight Rows with w/Date Check?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if date is between two dates, then sum only those rows streetcar Excel Worksheet Functions 2 February 16th 10 12:19 PM
formula to check the date sequence in rows brenda Excel Discussion (Misc queries) 4 July 2nd 09 04:34 AM
Hightlight date range Derek New Users to Excel 2 June 3rd 09 01:03 AM
format column to automatically move rows to date order Mark Kruger Excel Worksheet Functions 1 February 18th 08 09:53 PM
... Can I set Spell Check to automatically check my spelling ... Dr. Darrell Setting up and Configuration of Excel 0 March 21st 06 08:26 PM


All times are GMT +1. The time now is 12:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"