View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
loren.pottinger loren.pottinger is offline
external usenet poster
 
Posts: 34
Default Using DateAdd Function with cell values

Thanks Bob. F7 does contain a number. Could it be because I am using
cell values?

Bob Phillips wrote:
see response in public.excel

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"loren.pottinger" wrote in message
oups.com...
Both F7 and H7 contain a date yet this sub does not execute the
statements after Then.................Please help.

Sub GetAmOrDep()

Dim TestDate As Date
TestDate = DateAdd("m", Range("F7").Value, Range("H7").Value)

If TestDate < Range("I7").Value Then
Range("K7").Select
Selection.Copy
Range("M7").Select
ActiveSheet.Paste
End If
End Sub