I am running the same lines of code (the top code post) in about 10 different procedures so I wanted to create ONE module and just call it from there and do something like this (the bottom code post). Problem I have is that it highlights the RunThis line of code and says duplicate declaration in current scope, and I can't figure out what my problem is!!!
[vba]
Public Sub Enough()
Dim wbName() As Variant
Dim supName() As Variant
Dim cPDF As String
Di lCon As String
Dim firstVal As String
Dim matchVal As String
Dim q
wbName = Array("Alpha", "Omega", "Trillvil")
supName = Array("Richard", "George", "Jose")
For q = LBound(wbName) To UBound(wbName)
Call DrillOne(CStr(wbName(q)), PM, CStr(supName(q)), cPDF, lCon, firstVal, matchVal)
Call DrillTwo(CStr(wbName(q)), PM, CStr(supName(q)))
Next q
End Sub
[/vba]
[vba]
Dim wbName() As Variant
Dim supName() As Variant
Dim cPDF As String
Dim lCon As String
Dim firstVal As String
Dim matchVal As String
Dim q
wbName = Array("Alpha", "Omega", "Trillvil")
supName = Array("Richard", "George", "Jose")
Call RunThis(CStr(wbName)), CStr(supName)), cPDF As String, lCon As String, firstVal As String, matchVal As String, q)
End Sub
Public Sub RunThis(wbName, supName, cPDF, lCon, firstVal, matchVal, q)
For q = LBound(wbName) To UBound(wbName)
Call DrillOne(wbName, PM, supName, cPDF, lCon, firstVal, matchVal)
Call DrillTwo(wbName, PM, supName)
Next q
End Sub
[/vba]