Results 1 to 3 of 3

Need help of getting current month date from start to end!!

Threaded View

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    4

    Need help of getting current month date from start to end!!

    Hi,

    I have used the below code to get the current month date, but it is filling the date until the last cell i.e. 1 may 2012 to "last row date" something like 3-jan- 4015. Kindly help me to get the current month dates alone in the spread sheet.


    Sub CurrentMonthdate()
    'MsgBox Month(Now)
    'MsgBox Application.WorksheetFunction.EoMonth(Now(), 0)
    Range("A2").Select
    
    ActiveCell = Application.WorksheetFunction.EOMonth(Now(), -1) + 1
    ActiveCell.NumberFormat = "mm/dd/yyyy"
    While (ActiveCell <> Application.WorksheetFunction.EOMonth(Now(), 0))
        ActiveCell.Offset(1, 0).Select
        ActiveCell = ActiveCell.Offset(-1, 0) + 1
        ActiveCell.NumberFormat = "mm/dd/yyyy"
    Wend
    
    
    End Sub
    Last edited by arlu1201; 06-08-2012 at 06:12 AM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1