Re: Помогите с VBA
Идея следуящая:
Sub Test1()
'
' Test1
' 08.02.2006 (GNik527)
'
'
Dim i As Integer
Dim j As Integer
Dim ch As String
i = 7
Sheets("Лист1").Select
Do While Cells(i, 3).Value <> ""
ch = Cells(i, 3).Value
j = 7
Sheets("Лист2").Select
Do While Cells(j, 3).Value <> "" And Cells(j, 3).Value <> ch
j = j + 1
Loop
If Cells(j, 3).Value = ch Then
ch = Cells(j, 4).Value
Sheets("Лист1").Select
Cells(i, 4).Value = ch
Else
Sheets("Лист1").Select
End If
i = i + 1
Loop
End Sub
|