PDA

View Full Version : Solved: not finding workbook



CatDaddy
03-29-2012, 12:16 PM
I've used this code segment many times before but for some reason it is not finding the workbook I need...the full title of the workbook is "Daily Created 03.28.12.xls" any ideas why this would not work?
Dim wb As Workbook
Dim src1 As String
For Each wb In Application.Workbooks
If InStr(wb.Name, "Daily Created") Then
src1 = wb.Name
End If
Next wb
Workbooks(src1).Activate

CatDaddy
03-29-2012, 12:20 PM
when i replace the code with Workbooks("Daily Created 03.28.12.xlsx").Activate it says "error subscript out of range"...

CatDaddy
03-29-2012, 12:23 PM
never mind...closing and reopening macro workbook fixed the problem...no idea why