Re: $$Excel-Macros$$ Browsing through all open workbooks

2016-05-09 Thread Paul Schreiner
instead of "like", the function you're looking for is Instr() so, your macro should look something like: Sub Test()     Dim wb As Workbook     Dim DestinationFile As String, SourceFile As String         For Each wb In Workbooks     If (InStr(1, wb.Name, "D") > 0) Then     DestinationFi

$$Excel-Macros$$ Browsing through all open workbooks

2016-05-04 Thread Nitin Balodi
Hi All, I am trying to browse through all open workbooks and assign their names to variables based on some pattern. Below is the code I have written: Sub Test() Dim wb As Workbooks For Each wb In WorkbooksIf Workbook.Name Like "*123*" Then DestinationFile = ActiveWorkbook.NameElseI