Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Dates

Const limitDOWN As Date = #1/1/2007#
Const limitUP As Date = #2/2/2007#
Dim c As Range
For Each c In Worksheets("Instructions").Range("B7:B200").Cells
If c.Value limitDOWN & c.Value < limitUP Then
With c.Font
.Bold = True
.Italic = True
End With
End If
Next c


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Janos" wrote in message
...
Hello,

Sorry for the silly/basic question, but how can I compare dates? And would
I
be able to see if my cell is in a range of dates? I have this code that
doesn't work:

Const limitDOWN As Date = 1 / 1 / 2007
Const limitUP As Date = 2 / 2 / 2007
For Each c In Worksheets("Instructions").Range("B7:B200").Cells
If c.Date limitDOWN & c.Date < limitUPThen
With c.Font
.Bold = True
.Italic = True
End With
End If
Next c

Where is my Error?



 
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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
Toggle a range of Julian dates to Gregorian Dates and Back PSKelligan Excel Programming 4 May 8th 07 05:51 AM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM
Charting data against dates where dates are not at fixed intervals PK Charts and Charting in Excel 4 June 16th 05 05:08 AM


All times are GMT +1. The time now is 09:27 AM.

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"