• 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.

Need VBA

Hello SM Sir,

I need a little bit help in VBA. i have uploaded as sample file in which
in column "due date" hilighted with N.A, i want to fetch data only in No Due Date tab for only which "id" is N.A, and in one more tab
i want to fetch data for which "ids" date>=5 days from today.
so plz help me out ASAP
 

Attachments

  • SM.xlsx
    18.4 KB · Views: 3
Dear.. Ramesh

You can achieve this by Advance filter method in Excel VBA.. Please search this forum, you will get it..

Meanwhile I am preparing code for you... :)
 
Dear.. Ramesh

You can achieve this by Advance filter method in Excel VBA.. Please search this forum, you will get it..

Meanwhile I am preparing code for you... :)[/quote]

thanks bro! please do this asap.
 
Dear ..Ramesh

Please try this code.. and let me know the status. (Change code as per your requirement)
Code:
Sub DataFilter_No_Due_Date()
    Dim wkb As Workbook
    Dim sWks As Worksheet
    Dim rWks As Worksheet
    Dim fltRng As Range
    Dim criRng As Range
   
    Set wkb = ActiveWorkbook
    Set sWks = wkb.Sheets("Mantis Tickets(SOURCE DATA)") 'source sheet
    Set rWks = wkb.Sheets("NO Due Date") 'result sheet
   
    rWks.Select
    Range("A5").CurrentRegion.Clear
    rWks.Range("D2").Clear
    rWks.Range("D2").Value = "N.A" 'criteria
    Set fltRng = sWks.Range("A1").CurrentRegion
    Set criRng = rWks.Range("A1:J2") 'Criteria Range
   
    With fltRng
        .AdvancedFilter xlFilterCopy, criRng, Range("A5"), False
    End With
   
    Set fltRng = Nothing
    Set criRng = Nothing
    For Each Name In wkb.Names
        Name.Delete
    Next
End Sub
 
Dear ..Ramesh

Please try this code.. and let me know the status. (Change code as per your requirement)
Code:
Sub DataFilter_No_Due_Date()
    Dim wkb As Workbook
    Dim sWks As Worksheet
    Dim rWks As Worksheet
    Dim fltRng As Range
    Dim criRng As Range
  
    Set wkb = ActiveWorkbook
    Set sWks = wkb.Sheets("Mantis Tickets(SOURCE DATA)") 'source sheet
    Set rWks = wkb.Sheets("NO Due Date") 'result sheet
  
    rWks.Select
    Range("A5").CurrentRegion.Clear
    rWks.Range("D2").Clear
    rWks.Range("D2").Value = "N.A" 'criteria
    Set fltRng = sWks.Range("A1").CurrentRegion
    Set criRng = rWks.Range("A1:J2") 'Criteria Range
  
    With fltRng
        .AdvancedFilter xlFilterCopy, criRng, Range("A5"), False
    End With
  
    Set fltRng = Nothing
    Set criRng = Nothing
    For Each Name In wkb.Names
        Name.Delete
    Next
End Sub

Hi,

is this possible to do this in last uploaded sheet please. because i tried it but found error. so please do this for me once.
 
Hello Ramesh,

Was busy with some work. See the file, delete the data on two output sheets and run the code.

Regards,

Not an issue! Sir, I know, you will be busy.I will always wait you, if i have to learn something new.

Thanks a lot for this act. by the way i tried also to resolve this through recording macro using advance filter because i don't know to write macro on specific task.

thanks a lot once again!!
 
Back
Top