Re: $$Excel-Macros$$ date difference problem

2013-07-30 Thread Shankar Bheema
thank u deepak its working On Sat, Jul 27, 2013 at 12:09 AM, Deepak Barnwal wrote: > PFA > > Regards > > deepak > > > On Fri, Jul 26, 2013 at 11:28 PM, vba wrote: > >> PFA >> >> Actually years should be 37 & not 36!! >> >> HTH//Cheers >> >> >> On Fri, Jul 26, 2013 at 10:12 AM, Shankar Bheema >>

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Shankar Bheema
End Sub > > *From:* dguillett1 > *Sent:* Monday, September 12, 2011 1:04 PM > *To:* excel-macros@googlegroups.com > *Subject:* Re: $$Excel-Macros$$ date difference > > I am an advocate of the KISS (keep it simple stupid-not meant > personally) so stick with my original offe

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread dguillett1
difference I am an advocate of the KISS (keep it simple stupid-not meant personally) so stick with my original offering. From: Shankar Bheema Sent: Monday, September 12, 2011 10:58 AM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ date difference but i am using userform na sir

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread dguillett1
I am an advocate of the KISS (keep it simple stupid-not meant personally) so stick with my original offering. From: Shankar Bheema Sent: Monday, September 12, 2011 10:58 AM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ date difference but i am using userform na sir. So pls

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Sam Mathai Chacko
Shankar, IIF is an alternative for the IF Else.End if. statement to evaluate single-statement true-false comparisons. The *IIf* function is easier to debug and shortens the amount of code you need to write, and it takes for following format: IIf(Expression, TruePart, FalsePart) The

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Sam Mathai Chacko
Thought you wanted to increment date only... Try this Private Sub CommandButton1_Click() txtdor.Text = DateAdd("", 60, IIf(Day(CDate(txtdob.Text)) = 1, DateAdd("d", -1, CDate(txtdob.Text)), DateAdd("m", 1, DateSerial(Year(CDate(txtdob.Text)), Month(CDate(txtdob.Text)), 1)) - 1)) End Sub

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Shankar Bheema
amazing its working bro. i didnot understand that, in the code you have written IIf(Day(CDate(txtdob.Text). I thought its wrong and changed it to If(Day(CDate(txtdob.Text) then it thrown error. Why it happened so. IIf is what for ? On Mon, Sep 12, 2011 at 9:46 PM, Sam Mathai Chacko wrote: > An

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Sam Mathai Chacko
And if you go the formula way, try this =IF(DAY(A2)=1,DATE(YEAR(A2-1)+60,MONTH(A2-1)+1,0),DATE(YEAR(A2)+60,MONTH(A2)+1,0)) On Mon, Sep 12, 2011 at 9:43 PM, Sam Mathai Chacko wrote: > Thought you wanted to increment date only... > > Try this > > Private Sub CommandButton1_Click() > > txtdor.T

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Shankar Bheema
I tried with the provided code but its working only with the years but months and days are not working On Mon, Sep 12, 2011 at 9:33 PM, Sam Mathai Chacko wrote: > Private Sub CommandButton1_Click() > > txtdor.Text = DateAdd("", 60, IIf(Day(CDate(txtdob.Text)) = 1, > DateAdd("d", -1, CDate

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Sam Mathai Chacko
Private Sub CommandButton1_Click() txtdor.Text = DateAdd("", 60, IIf(Day(CDate(txtdob.Text)) = 1, DateAdd("d", -1, CDate(txtdob.Text)), CDate(txtdob.Text))) End Sub Regards, Sam Mathai Chacko (GL) On Mon, Sep 12, 2011 at 9:28 PM, Shankar Bheema wrote: > but i am using userform na sir.

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread Shankar Bheema
but i am using userform na sir. So pls see my attachment and i am not understanding the mistake i did in my code On Mon, Sep 12, 2011 at 9:07 PM, dguillett1 wrote: > Why not just a simple formula for a dob in cell d11 > > =DATE(YEAR(D11)+60,MONTH(D11)+1,0) > > *From:* Shankar Bheema > *Se

Re: $$Excel-Macros$$ date difference

2011-09-12 Thread dguillett1
Why not just a simple formula for a dob in cell d11 =DATE(YEAR(D11)+60,MONTH(D11)+1,0) From: Shankar Bheema Sent: Monday, September 12, 2011 9:54 AM To: excel-macros@googlegroups.com Subject: $$Excel-Macros$$ date difference Hai all, I am attaching an excel userform which conta

Re: $$Excel-Macros$$ Date Difference

2011-07-01 Thread Chandra Shekar
Thanks a lot :-) On Fri, Jul 1, 2011 at 6:06 PM, ashish koul wrote: > try the attachment > > > On Fri, Jul 1, 2011 at 3:50 PM, Chandra Shekar < > chandrashekarb@gmail.com> wrote: > >> Hi, >> >> I need a formula which need to ignore weekends. Thanks >> >> For Ex: >> >> A1=01/07/2011 - Input >

RE: $$Excel-Macros$$ Date Difference

2011-07-01 Thread Daniel
Hello, Consider the NETWORKDAYS function. If you are using an older version than Excel 2007, you’ll have to install the Analysis Tool Pack. HTH Daniel De : excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] De la part de Chandra Shekar Envoyé : vendredi 1 juillet 201

Re: $$Excel-Macros$$ Date Difference

2011-07-01 Thread ashish koul
try the attachment On Fri, Jul 1, 2011 at 3:50 PM, Chandra Shekar wrote: > Hi, > > I need a formula which need to ignore weekends. Thanks > > For Ex: > > A1=01/07/2011 - Input > B1=30/06/2011 - Result1 > C1=04/07/2011 - Result2 ' 02/07/2011 & 03/07/2011 are saturdays and > sundays. > > -- > > --