协助实施子文件夹search到我的代码

我写了一个代码,用于search并复制.xls文件(Proposals)中的单元格。 我的问题是我有E:\ Bids(年)(项目)。 我最近添加了代码来提示用户(我)select子文件夹。
我读了vba-macro-that-search-for-file-in-multiple-subfolders,但是我是新手。 我想我不明白如何将function实现到VBA代码。 有没有一个网站,我可以去了解这个? 我更多地要求钓鱼课,而不是要求你提供一条鱼。 请让我知道,如果我应该发表这个作为对上述问题的评论,而不是发表一个新的职位。

Sub BidDB() Dim SummarySheet As Worksheet Dim FolderPath As String Dim NRow As Long Dim FileName As String Dim WorkBk As Workbook Dim sourceRange As Range Dim DestRange As Range Dim FileToOpen As String 'Application.ScreenUpdating = False ' Create a new workbook and set a variable to the first sheet. Set SummarySheet = ActiveWorkbook.ActiveSheet ' Folder than contains the files 'FolderPath = "Z:\Bids\" ' Where to insert new rows in the destination workbook. NRow = 3 ' Dir to find all Excel files in the folder path. 'FileName = Dir(FolderPath & "*.xls") FileName = Application.GetOpenFilename("Excel workbooks (*.xls*), *.xls*") ' Loop until Dir returns an empty string. Do While FileName <> "False" 'Open a workbook in the folder 'Set WorkBk = Workbooks.Open(FolderPath & FileName) Set WorkBk = Workbooks.Open(FileName) ' Set the cell in column A to be the file name. SummarySheet.Range("A" & NRow).Value = FileName ' Date Set sourceRange = WorkBk.Worksheets(1).Range("H4:I4") Set DestRange = SummarySheet.Range("B" & NRow) Set DestRange = DestRange.Resize(sourceRange.Rows.Count, _ sourceRange.Columns.Count) DestRange.Value = sourceRange.Value ' Increase NRow so that we know where to copy data next. NRow = NRow + DestRange.Rows.Count ' Close the source workbook without saving changes. WorkBk.Close savechanges:=False ' Use Dir to get the next file name. 'FileName = Dir() FileName = Application.GetOpenFilename("Excel workbooks (*.xls*), *.xls*") Loop ' Call AutoFit on the destination sheet SummarySheet.Columns.AutoFit 'Application.ScreenUpdating = True 

结束小组