
Originally Posted by
SamuelT
Hi,
Thanks for all your input so far. Perhaps I should of shown you this before. The full piece of VBA is as below. As well as searching for "Katherine Hatch" (to be replaced by "A1", I've also got a password unprotect and reprotect thing going on. Also I don't know if the first line makes the Criteria1:=worksheets("sheet1") part of the code suggested by funkymonk redundant as I've already stated it before.
Sub KH()
Sheets("Components").Visible = True
Sheets("Capacity").Visible = True
Sheets("Billing").Visible = True
Sheets("Extra Fees Calculator").Visible = True
Sheets("Control").Visible = True
Sheets("Programme (2 Week)").Select
ActiveSheet.Unprotect Password:="donottouch"
Selection.AutoFilter Field:=10, Criteria1:="Katherine Hatch"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="donottouch"
Sheets("Programme (High Level)").Select
ActiveSheet.Unprotect Password:="donottouch"
Selection.AutoFilter Field:=10, Criteria1:="Katherine Hatch"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="donottouch"
Sheets("Capacity").Select
ActiveSheet.Unprotect Password:="donottouch"
Selection.AutoFilter Field:=33, Criteria1:="Katherine Hatch"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="donottouch"
Sheets("Components").Select
ActiveSheet.Unprotect Password:="donottouch"
Selection.AutoFilter Field:=3, Criteria1:="Katherine Hatch"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="donottouch"
Sheets("Billing").Select
ActiveSheet.Unprotect Password:="donottouch"
ActiveWindow.ScrollColumn = 1
Selection.AutoFilter Field:=3, Criteria1:="Katherine Hatch"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="donottouch"
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Extra Fees Calculator").Select
ActiveSheet.Unprotect Password:="donottouch"
Selection.AutoFilter Field:=3, Criteria1:="Katherine Hatch"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="donottouch"
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Programme (2 Week)").Select
End Sub
Thanks guys,
SamuelT
Bookmarks