Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Arithmetic with Cell Dates

Hi all, looking for some help. I'm trying to use a For loop to look through a list of dates in a worksheet and flag cells whose dates are greater than 100 days.


Set Date_Range = Sheets("Sheet1").Range("A1:A500")
YearStartDate = DateSerial(2014, 1, 1)
For Each DateVal In Date_Range
DateAge = DateVal - YearStartDate
If DateAge 100 Then
MsgBox DateVal.Address & "is greater than 100 days
End If
Next DateVal


The code gives an error. Is it because DateVal and YearStartDate are different data types?
Reply
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
Writing the result of arithmetic calculation in a cell Merike Excel Programming 5 October 29th 06 08:30 PM
About arithmetic Formulas Ravindrapawanbindabinurajendradhamidevfa Excel Discussion (Misc queries) 2 August 13th 06 05:03 PM
CurrentDate + 3 months (arithmetic with dates???) mvyvoda Excel Programming 4 December 17th 05 01:47 AM
bad arithmetic pod Excel Programming 1 February 11th 05 04:39 PM
Formatting cell and doing date arithmetic Stephen Closson Excel Programming 1 January 13th 04 08:40 PM


All times are GMT +1. The time now is 04:36 AM.

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

About Us

"It's about Microsoft Excel"