|
楼主 |
发表于 2013-4-27 11:30
|
显示全部楼层
本帖最后由 star181149 于 2013-4-27 11:33 编辑
hoogle 发表于 2013-4-27 11:22
给你举个小例子,自己试下
sub hoogle()
if cells(1,1)=cells(1,2) then
Private Sub workbook_open()
Worksheets("zjd").Activate
Dim i As Integer
Dim j As Integer
i = 1
j = 1
Do While i < 2000
Do While j < 2000
If Cells(i, 2) = Cells(i, 3) Then
Cells(i, 4) = Cells(i, 7)
ElseIf Cells(i, 2) = Cells(i + j, 3) Then
Cells(i, 4) = Cells(i + j, 7)
Else: Cells(i, 4).Value = "不匹配"
End If
i = i
j = j + 1
Loop
i = i + 1
Loop
End Sub
求指导! |
|