Sub openExcelFile(ByVal filePath$)
Set xls = CreateObject("Excel.Application")Set xlbook = xls.Workbooks.Open(filePath)'xls.Visible = TrueSet xlsheet = xlbook.Worksheets(1)Application.ScreenUpdating = False With xlsheet MsgBox .[a2] End With Application.ScreenUpdating = Truexlbook.Close (True) xls.Quit Set xlsheet = Nothing Set xlbook = Nothing Set xls = Nothing End SubSub getSheetName()For Each sht In ThisWorkbook.Sheets With sht If .Cells(2, 1).Value <> "" Then .Cells(2, 1).Interior.ColorIndex = 45 End WithNextEnd SubSub getSheetName()Dim arrDim c As RangeFor Each sht In ThisWorkbook.Sheets If sht.Name = "Sheet2" Then With sht Set St = Worksheets("sheet1") 'MsgBox St.[a1].End(2).Column For i = 1 To St.[a1].End(2).Column 'St.[a65536].End(3).Row If St.Cells(1, i).Value = .Name Then For ii = 1 To .[a65536].End(3).Row 'If .Cells(ii, 1).Value Then Set c = St.Range(St.Cells(1, i), St.Cells(St.Cells(65536, i).End(3).Row, i)).Find(.Cells(ii, 1), , , 1) If Not c Is Nothing Then MsgBox "a" End If Next Exit For End If 'If .Cells(2, 1).Value <> "" Then .Cells(2, 1).Interior.ColorIndex = 45 Next End With End IfNextEnd Sub