View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Search File Windows in same Excel

Sure you can.....

Sub MyMacroTest()
ActivateBookwithKeyword ("flow")
'your rest of the code do something

ActivateBookwithKeyword ("<different one")
'code to do something

ActivateBookwithKeyword ("<different one")
'code to do something

End Sub

Sub ActivateBookwithKeyword(strSearch As String)
For intTemp = 1 To Workbooks.Count
If InStr(1, Workbooks(intTemp).Name, strSearch, 1) < 0 Then
Workbooks(intTemp).Activate
Exit Sub
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Elton Law" wrote:

Hi Friend,
It works .... that's is great. Tks tks tks tks a lot ....
Just one final question ....
Is it possible .... even to skip the typing job "Flow" ...
I want to pre-define in VB and then just run ... all will go ....
Thanks in advance,


"Jacob Skaria" wrote:

OK. In VBE from menu Insert a New Module..Copy the below two procedures and
then try running MyMacroTest.. In the input box you try entering "flow" which
will activate your workflow.xls...

Sub MyMacroTest()

strFile = InputBox("Enter Search String")
ActivateBookwithKeyword (strFile)
End Sub

Sub ActivateBookwithKeyword(strSearch As String)
For intTemp = 1 To Workbooks.Count
If InStr(1, Workbooks(intTemp).Name, strSearch, 1) < 0 Then
Workbooks(intTemp).Activate
Exit Sub
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria