Filter and name the rows when available

Hudson Andrew

New Member
Joined
Sep 28, 2016
Messages
31
Hi all ,

Mr excel been quite help full to all who seek assistance in the fields of VBA and excel . i have been wondering if some one from the form helps me how to fix the below code to fuction more dynamic.

let say for example : below code filter column (K) " DA,DB,DZ" and put a a comment in adjacent column ("S") " Deduction". so far so good . if " DA DB,DZ " seems missed it should not give any output . however below code is changing header of the column " S " in absence of "DA,DB,DZ" ..

Code:
[/COLOR]Sub filter_deduction()      
    Range("K1:K" & Range("K" & Rows.Count).End(3).Row).AutoFilter 1, Criteria1:=Array("DA", "DB", "DZ"), Operator:=xlFilterValues 
     
    Range("S2:S" & Range("K" & Rows.Count).End(3).Row).SpecialCells(12).Formula = "Deductions" 
     
     
    ActiveSheet.AutoFilterMode = False 
End Sub 


[COLOR=#333333]

now i would request some one to advice how to put a pause to the below code if the " DA, DB,DZ " misses in the filter criteria . below is the code for your reference.

i have raised the same question in below forum.

Filter and name the rows when available
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,655
Messages
6,126,053
Members
449,283
Latest member
GeisonGDC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top