Dear Bheema,

Please try it..........and see attached sheet..
**
*Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox17.Text = VBA.DatePart("m", CDate(TextBox2.Text)) - VBA.DatePart("m",
CDate(TextBox1.Text))
End Sub
*
-- 
Thanks & regards,
Noorain Ansari
 *http://excelmacroworld.blogspot.com/*<http://excelmacroworld.blogspot.com/>
*http://noorain-ansari.blogspot.com/* <http://noorain-ansari.blogspot.com/>

On Thu, Sep 15, 2011 at 7:25 PM, Shankar Bheema <shankar.n...@gmail.com>wrote:

> hai all,
>
> I am attaching my excel sheet userform.  I am getting wrong result of
> months in different way.
> for example :
> Actual months difference between 01-02-2011 and 30-06-2011 are 5 months
>  but the result coming as 4
>
> pls provide solution
>
> --
>
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links :
> http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><><><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Attachment: datepart.xlsm
Description: Binary data

Reply via email to