excel简单VBA编程 的答案
发布网友
发布时间:2022-10-08 21:53
我来回答
共1个回答
热心网友
时间:2023-11-18 09:24
Sub test()
Dim i, r, s As Long
Dim str, findvalue As String
r = Range("a65536").End(xlUp).Row
For i = 2 To r
str = Cells(i, 6).Value
Set findvalue = ActiveSheet.Rows(1).Find(what:=str)
If Not findvalue Is Nothing Then
s = findvalue.Column
Cells(i, 7).Value = Cells(i, s).Value '
End If
Next i
End Sub