Hi All,
Every month i have to create report using 5 diffrent files where file name remain same but only date format change.Files names are in below format
1) IND_abc_MAPPING20130502 (date format is YYYY-MM-DD)
2) IND_abc_TABLE20130502 and so on
so far code is working perfect where code ask user to select path from where he has to select files but i am stuck after that (code highlted in red) after opening all 5 files i have activate particular file and have to copy data from respective file for eg. after opening all 5 files first i have to activate 3rd file nd copy data then 5th file and so on and my problem is that every month file name will change for eg this month file name would be "IND_abc_MAPPING20130502" Next month it will be 20130602 and so on. so i need a code so that macro will activate open file using any particular word of file name because every month file name will be same only date will change.
Sub GetFolder()
Dim wb As Excel.Workbook
Set abc = Application.FileDialog(msoFileDialogFilePicker)
With abc
MsgBox "Select Diamond Mapping file from dialog box"
.Title = "Choose Files"
.AllowMultiSelect = False
If .Show <> -1 Then
'Exit Sub
End If
FolderSelected = .SelectedItems(1)
Set wb = Workbooks.Open(Filename:=FolderSelected)
End With
MsgBox "You Selected:" & FolderSelected
Windows("IND_abc_MAPPING20130502.csv").Activate
End Sub
Dorry for any confusion. do let me know if you need any more clarification from my side.
Thanks in advance !!!
Suyog patil
Bookmarks