• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Dates pull before 6 months & after todays date

Abhijeet

Active Member
Hi

I have change date format if date in cell but i need if any date before 6 months & after todays date any dates then cut paste that row in different workbook please tell me how to do this
Code:
Sub US_Date_Format()
    Application.ScreenUpdating = False
    With ActiveSheet
        y_max = .UsedRange.Rows.Count
        x_max = .UsedRange.Columns.Count
        For y = 1 To y_max
            For x = 1 To x_max
                If IsDate(.Cells(y, x)) Then .Cells(y, x).NumberFormat = "[$-409]dd/mmm/yy;@"
                If IsDate(.Cells(y, x)) Then .Cells(y, x).HorizontalAlignment = xlCenter
            Next x
        Next y
    End With
    Application.ScreenUpdating = True
End Sub
 
Hi,Hui

Please find attach file current macro look each cell date but i need from Column M to U i any date hen change format then find below 6 month & above current date if any find then cut paste that row in different work book
 

Attachments

  • Element wise Date format.xlsm
    15 KB · Views: 7
Back
Top