Hi Riazz. It's Saturday and I'm bored. U have outlined a rather extensive request to be quickly completed by others. It also seems that U are getting paid to complete this task...forum members are not. Generally speaking, forums provide others help with completing specific areas of difficulty that they are having difficulty. Having typed that, like I mentioned I thought that I would provide U with some code to get U started. It will take U to part way through "C" above... being that after that you're request becomes unclear? HTH. Dave
Option Explicit
Sub Test()
Dim Lastrow As Double, sht As Worksheet, Cnt As Double, FSO As Object
Dim FlDr As Object, Fl As Object, FileNm As Object
Set FSO = CreateObject("scripting.filesystemobject")
'***change Folder path/name to your folder path/name
Set FlDr = FSO.GetFolder("YOUR FOLDER PATH AND NAME")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each Fl In FlDr.Files
If Fl.Name Like "*.xlsx" Then
Workbooks.Open Filename:=FileNm
For Each sht In Workbooks(FileNm.Name).Sheets
If sht.Name = "Sheet1" Then
With Sheets(sht.Name)
Lastrow = .Range("C" & .Rows.Count).End(xlUp).Row
MsgBox Fl.Name & " Lastrow of C is: " & Lastrow ' & " Value: " & .Range("C" & Lastrow).Value
End With
Exit For
End If
Next sht
Workbooks(FileNm.Name).Close SaveChanges:=False
End If
Next Fl
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Set FlDr = Nothing
Set FSO = Nothing
Exit Sub
erfix:
On Error GoTo 0
MsgBox "Error"
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Set FlDr = Nothing
Set FSO = Nothing
End Sub