pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
I have code
The thing is that my file name changes every day ("Backup Data September 28, 2010.xlsm") just the date.
Can some hel me set up how to look for the workbook and select
like Backup Data & month & i &,.xlsm etc???
Not sure how to set this question up...
i want to be able to look for file name through loop or something....
yesterday someone gave me this code which might help but not sure how to set this up.
Thanks for helping!
Code:
Sub try121()
Dim wb As Workbook
Windows("[COLOR=blue]Backup Data September 28, 2010.xlsm[/COLOR]").Activate
Sheets("Dater").Select
LstRw = Cells(Rows.Count, "O").End(xlUp).Row
Range("O1:O" & LstRw).AutoFilter Field:=1, Criteria1:="Y"
Range("B2:B" & LstRw).SpecialCells(xlCellTypeVisible).Copy _
ThisWorkbook.Sheets("Data").Cells(Rows.Count, "G").End(xlUp)(2)
AutoFilterMode = False
ThisWorkbook.Activate
End Sub
The thing is that my file name changes every day ("Backup Data September 28, 2010.xlsm") just the date.
Can some hel me set up how to look for the workbook and select
like Backup Data & month & i &,.xlsm etc???
Not sure how to set this question up...
i want to be able to look for file name through loop or something....
yesterday someone gave me this code which might help but not sure how to set this up.
Code:
Sub try2()
Dim ws As Worksheet
For i = 1 To 30 'to 6? to whatever.
On Error Resume Next
Set ws = Workbooks("Backup Data September (" & i & "), 2010.xls").ActiveSheet
On Error GoTo 0
If Not ws Is Nothing Then
Workbooks("Try.xlsm").Activate
ws.Range("A1").Copy
ActiveSheet.Paste
Application.CutCopyMode = False
Exit For
End If
Next i
End Sub
Thanks for helping!