Shankar, The problem with date conversions of text formats to date formats in visual basic 6 and VBA is that by default, it considers date as mm/dd/yyyy, and not like the Indian version dd/mm/yyyy. In your case, 01-02-2011 is converted or seen as 2nd January 2011. To avoid this, use dd-mmm-yyyy format, instead of dd-mm-yyyy.
Regards, Sam Mathai Chacko 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 > -- Sam Mathai Chacko -- ---------------------------------------------------------------------------------- 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