hello there,
i need your help quite urgently. i know that this may seem to be quite simple to some but i've been cracking my head for the longeest time but i cant seem to think of the solution to my problem.
please help.
ok here goes......
i am creating a MACRO that i will have to delete rows and then apply filters to the remaining data to show it in a certain sequence. i have already done the first part but i'm stuck at the second part right now.
i want to apply the autofilter but i do not know how to "call" the field from the header of the column. i need to do so because the rows will not always be the same and i need to know the procedure on how to call a column from the title header and then apply the filter.
attached to this message is the first coding that i did to erase the rows at the beginning and it works perfectly fine.
now all i want to know is how do i appy the filters based on the header of the rows instead of using the row number??
please help me out asap on this.
thank you so very much.
regards
sam
Public Sub DeleteCols()
Dim vHeadings, lngHeading As Long
vHeadings = Array("Report Number", "Report Title", "Report Type", "Report Overall Rating Code", "Finding Type", "Current issue Status", "Date of Last Status Update", "Status Update co-ordinator", "Delegated Accountable", "Responsible to Resolve", "Vendor", "Plan in Place", "Postpone Tally Resolution", "Recommendation", "Last Status Update Comment", "Date of Closure", "Finding Status", "SOXA Category", "SCP", "USLCP", "Dependencies", "Waiver Valid until", "Audit Subject_I", "Legal Entity_I", "Final Report Issue Date")
For lngHeading = LBound(vHeadings) To UBound(vHeadings)
On Error Resume Next
Columns(Application.Match(vHeadings(lngHeading), Rows(1), 0)).Delete
On Error GoTo 0
Next lngHeading
End Sub
Bookmarks