View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Brian Brian is offline
external usenet poster
 
Posts: 12
Default Inputbox Default to be Upcomming Sunday

I figured it out by using the following code

Sub sunday()


If Weekday(Date) = vbSunday Then
DaT = Date

ElseIf Weekday(Date) = vbMonday Then
DaT = Date + 6

ElseIf Weekday(Date) = vbTuesday Then
DaT = Date + 5

ElseIf Weekday(Date) = vbWednesday Then
DaT = Date + 4

ElseIf Weekday(Date) = vbThursday Then
DaT = Date + 3

ElseIf Weekday(Date) = vbFriday Then
DaT = Date + 2

ElseIf Weekday(Date) = vbSaturday Then
DaT = Date + 1


End If
End Sub

Brian wrote:
I have a input box that is looking for a date.

DT = InputBox("Enter New Date: ", Date)

I would like have the default value of the inputbox as the upcomming
sunday( Today is 6-29-06 default value should show 7-2-06)

Thanks in advance