Good Afternoon,
I am trying to create a facilty to search an number of spreadsheet via 2 criteria 1. Manager Name and Order No, but i am having an issue starting the VB as i need to name the 2 cells on a sheet called "Amend Quality" so i can run a module. I have tried a few ways but get a fault wach time.
What is the best way to name cell "D4" - Manager & "D11" - Order No. so they can be used in the module.
I have the following that i hopefully can use
Is there any way that is best to run this as i have 3 managers the Macro will need to search through. Currently using the VB above i will have to create this on a loop 3 times. Is there anyway i can do this without looping the VB. I used to use the code below but i am having problems with it even though all the info is Public for the names
Many Thanks
I am trying to create a facilty to search an number of spreadsheet via 2 criteria 1. Manager Name and Order No, but i am having an issue starting the VB as i need to name the 2 cells on a sheet called "Amend Quality" so i can run a module. I have tried a few ways but get a fault wach time.
What is the best way to name cell "D4" - Manager & "D11" - Order No. so they can be used in the module.
I have the following that i hopefully can use
Code:
If "D4" = "Manager 1" Then
ActiveWorkbook.Sheets("Ashley Longman").Activate
Set ws = Worksheets("Ashley Longman")
Set MyFind = Columns(5).Find(what:="D11", searchdirection:=xlNext, lookat:=xlWhole)
If Not MyFind Is Nothing Then
ExtractRow = MyFind.Row
Else
MsgBox "Cannot find value " & MyProcessNumber
Exit Sub
End If
Set MyFind = Nothing
'VB then to pull in info
Is there any way that is best to run this as i have 3 managers the Macro will need to search through. Currently using the VB above i will have to create this on a loop 3 times. Is there anyway i can do this without looping the VB. I used to use the code below but i am having problems with it even though all the info is Public for the names
Code:
For Each MySht In MyWB.Sheets
If MySht.Name = MyManager Then
MySht.Select
Exit For
End If
Next MySht
Many Thanks