Akeel Mohamed
New Member
Hi there,
I have just started working on Macro's where I work and this is my first one. So far its going well except for one issue that I run into. When I run the Macro if the name of the person is not on the list (Ex. "Simpson, Homer" not on the list) it will use my formula and put the name associated in every line below. I'm not sure what I can do to stop this from happening.
What I want the macro to do is filter for the names and change the information only when its there. Would anyone have any suggestions on how to do this? Thanks for all your help! Looking forward to being an active part of the community
I have just started working on Macro's where I work and this is my first one. So far its going well except for one issue that I run into. When I run the Macro if the name of the person is not on the list (Ex. "Simpson, Homer" not on the list) it will use my formula and put the name associated in every line below. I'm not sure what I can do to stop this from happening.
What I want the macro to do is filter for the names and change the information only when its there. Would anyone have any suggestions on how to do this? Thanks for all your help! Looking forward to being an active part of the community
Code:
Selection.AutoFilter
ActiveSheet.Range("$A$2:$W$42").AutoFilter Field:=8, Criteria1:=Array( _
"Coordinator, Window", "Arun, Master", Frank, Muhat"), Operator:= _
xlFilterValues
Range("B3").Select
Range(Selection, Selection.End(xlDown)).FormulaR1C1 = "Non Store Mgmt"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$2:$W$42").AutoFilter Field:=8, Criteria1:=Array( _
"Simpson, Homer", "Ramroller, Sabiitters"), Operator:=xlFilterValues
Range("B3").Select
Range(Selection, Selection.End(xlDown)).FormulaR1C1 = "Store Mgmt"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$2:$W$42").AutoFilter Field:=8, Criteria1:=Array( _
"Halo, See", "Cab, My"), Operator:=xlFilterValues
Range("B3").Select
Range(Selection, Selection.End(xlDown)).FormulaR1C1 = "Pushers"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$2:$W$42").AutoFilter Field:=8, Criteria1:=Array( _
"Telling, OnYou", "Pax, Raqmy"), Operator:=xlFilterValues
Range("B3").Select
Range(Selection, Selection.End(xlDown)).FormulaR1C1 = "Sales"
ActiveSheet.ShowAllData
Last edited by a moderator: