Hi All
I am trying to write a code for a cell on sheet 1 where the user inputs the value of date and in the next column or in the next sheet it should 6 months less 1 day. for example if user enters 01/01/2012 the result should be 30/06/2012 instead of exactly 01/07/2012 . I have tried the code below. The below code works for me to show exactly 6 months. But when i use "d" Instead of "m" some times the date values are incorrect. I Think thats because some have 30 days and others have 31 days. how to correct the code below so that it gives always 1 day less than 6months.
Many thanx
D28 = 01/01/2012
If Range("D24").Value = "FIXED" Then
Range("D29").Value = DateAdd("m", 6, Range("d28").Value)
else
Range("D29").Value = "XXXX"
End If
Bookmarks