Hello Friends,
I have typed the following code and there is a type mismatch error at the last line. Please help.
Sub ConsolidatePDCA_Test()
Dim sourceExcel As Workbook
Dim destExcel As Workbook
Dim destSheet, plbfdValue, plbfdimValue, plbfdneValue As String
Dim imCount, neCount, tempCount As Integer
Dim unitCell As Range
Dim unitCell2 As Range
Dim posRange, posRange2 As Range
Dim rowCursor As Range
Dim plantValue, bfdValue, mmyyyValue, ctgyValue As String
Dim mainFolder, sFolder, ssFolder, objFSO, xlFile
Set destExcel = ActiveWorkbook
destSheet = "Master_Data"
Set rowCursor = Range("A7")
plantValue = Sheets("Dock").Range("F3").value
bfdValue = Sheets("Dock").Range("F4").value
mmyyValue = Sheets("Dock").Range("F5").Text
ctgyValue = Sheets("Dock").Range("F6").value
Set objFSO = CreateObject("Scripting.FileSystemObject")
' myFileNames = Split(LCase(Range("a1")), ";")
Set mainFolder = objFSO.GetFolder("C:\Users\g41468\Desktop\01_Management_Meetings - Copy\")
For Each sFolder In mainFolder.subfolders
For Each ssFolder In sFolder.subfolders
If ssFolder.Name Like "*" & mmyyValue & "*" Then
For Each xlFile In ssFolder.Files
If xlFile.Name Like "PDCA*" & "*.xls" Then
'////////////Loop starts
Set sourceExcel = Application.Workbooks(xlFile).Open
Bookmarks