this is good thanks a lot!!
________________________________
From: David Grugeon <yahoo@grugeon.com.au>
To: ExcelVBA@yahoogroups.com
Sent: Monday, 16 January 2012 3:04 AM
Subject: RE: [ExcelVBA] MonthFunction
Hi Nishu
Try formatting A3 as a date rather than as text and then with the cell
selected click F2 and Enter.
The cell is probably formatted as text so it contains the string
"25/07/1985" rather than the date value.
Another solution to this would be to use
Mon = Month(Datevalue(A3))
Best Regards
David Grugeon
Excel VBA Group Moderator
-----Original Message-----
From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On Behalf
Of Nishu Kumar
Sent: Monday, 16 January 2012 4:13 AM
To: excelvba@yahoogroups.com
Subject: [ExcelVBA] MonthFunction
Hello group,
Please assist me to get the current month. the problem is month "12" is
coming at all the time whenever i give reference of sheet 1. for example:
here is my coding:
Sub Mymonth()
Dim Mon As Integer
Mon = Month(A3) 'the value in A3 is 25/07/1985 and even changed to
07/25/1985 Cells(5, 1).Value = Mon End Sub
the answer of above query is 12 which is not correct
Please assist me as where i am going astray.
Regards,
Nishu
[Non-text portions of this message have been removed]
------------------------------------
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
here: http://www.mousetrax.com/techtrax to enter the ezine, then search the
ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------Yahoo! Groups Links
[Non-text portions of this message have been removed]
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar