Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Want to calculate the appointment date and deappointment date?


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Want to calculate the appointment date and deappointment date?

I should have read your post more closely. You want to base the change on
the value in A1, I believe.

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") = Range("A1").Value - 1
ElseIf Target.Value = "DEPPT" Then
Range("C2") = Range("A1").Value + 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Want to calculate the appointment date and deappointment date?


JLGWhiz;413560 Wrote:
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: 'The Code Cage Forums - View Profile: Raja'

(http://www.thecodecage.com/forumz/member.php?userid=497)
View this thread:
'Want to calculate the appointment date and deappointment date? - The

Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...d.php?t=115205)




Thanks but its not working.

please advice...

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Want to calculate the appointment date and deappointment date?


Hi JLGWhiz,

Your code working only for the B2 in the example i had mentioned it for
the understanding.Ok to explain you further say ill always copy paste
the date in A:A and "APPT" OR DEAPPT" IN B:B and i need those outcome in
C:C always.
Sorry for not explaining them earlier.

Many thanks,

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

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
calculate the date from ceased work date after a certain waiting p brenda Excel Discussion (Misc queries) 2 April 20th 09 08:30 AM
Trying to calculate end date using order date and lead time variab BWA Excel Worksheet Functions 3 August 15th 08 04:48 PM
Auto calculate for date + days forward to yield new date John Sullivan Excel Worksheet Functions 1 April 22nd 06 05:18 PM
formula to calculate future date from date in cell plus days Chicesq Excel Worksheet Functions 8 November 3rd 05 12:25 PM
date stamp & appointment tru excel P Dirks Excel Programming 0 December 19th 04 12:29 PM


All times are GMT +1. The time now is 01:38 PM.

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"