View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Want to calculate the appointment date and deappointment date?

Copy and paste this to your worksheet code module.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B2") Then
Range("C2").NumberFormat = "dd-mmm-yy"
If Target.Value = "APPT" Then
Range("C2") = Date - 1
ElseIf Target.Value = "DEPPT" Then
Range("C2") = Date + 1
End If
End If
End Sub



"Raja" wrote in message
...

Hi All,

Greeting for the day.

I have date 12-Jul-09 in cell A1

If i enter "APPT" In cell B2 then C2 have to show 11-Jul-09 (D-1)

If it is "DEPPT" IN Cell B2 then C2 have to show 13-Jul-09 (D+1)

Note : This APPT and DEPPT will be mixed together ill just copy paste
them into a Sheet when i do that i need a VBA program to show these days
automatically.

Any help would be appreicated.

Regards,

Raja


--
Raja
------------------------------------------------------------------------
Raja's Profile: http://www.thecodecage.com/forumz/member.php?userid=497
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=115205