... And you could always pick up the two values...
Something like....
dtlPreviousDate = ActiveCell.Offset(-1,0).Value
ilPrevioiusNumber = ActiveCell.Offset(-1,-1).Value
if Year(dtlPreviousDate) = Year(dtlThisDate) then
ilNewNumber = ilPreviousNumber + 1
else
ilNewNumber = 1
endif
With Target(1, 0)
.Value = ilNewNumber
End With
... not tested.
HTH
LIsa
[Non-text portions of this message have been removed]
__._,_.___
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (3) |
----------------------------------
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
----------------------------------
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