你的话没描述明白,那就给你些提示性的东西吧
Dim i As Integer
Dim WorkbookA As Workbook
Dim WorkbookB As Workbook
Dim WorksheetA As Worksheet
Dim WorksheetB As Worksheet
Dim RangeA As Range
Dim RangeB As Range
Set WorkbookA = ThisWorkbook
Set WorkbookB = Application.Workbooks.Open("C:\B.xlsx")
Set WorksheetA = WorkbookA.Sheets("Sheet3")
Set WorksheetB = WorkbookB.Sheets("Sheet2")
For i = 1 To 100
Set RangeA = WorksheetA.Cells(i, 10)
If InStr(RangeA.Formula, "SUM") > 0 Then
Exit For
End If
Next i
For i = 1 To 100
Set RangeB = WorksheetB.Cells(6, i)
If RangeB.Text <> "" Then
Exit For
End If
Next i
If RangeA <> Null And RangeB <> Null Then
Set RangeB.Text = RangeA.Text
End If