I recorded these two macros to increment / decrement a date used in a
database query. I assigned them to two buttons that users can use to page
through sales activity one day at a time.

Now I want to limit the range of dates available.

For the NextDate macro, if the resulting date is greater than "today", I
want it to revert to "today".

For the PrevDate macro, if the resulting date is less than "today -14", it
should stay at "today-14".

I don't know enough VBA to make it happen (I just use the recorder), but I
know there are many here who can do it.

Cell B1=1, Cell C1 contains the date being changed.
--
Carlos
=================================================

Sub NextDate()
'
' NextDate Macro
' Macro recorded 01/12/2006 by Carlos
'

'
Range("B1").Select
Selection.Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlAdd,
SkipBlanks _
:=False, Transpose:=False
End Sub
----------------------------------------------------------------------------
Sub PrevDate()
'
' PrevDate Macro
' Macro recorded 01/12/2006 by Carlos
'

'
Range("B1").Select
Selection.Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlSubtract, _
SkipBlanks:=False, Transpose:=False
End Sub