excel求公式或vba?请高手帮忙

2024-10-31 03:28:45
有2个网友回答
网友(1):

Public Sub cfzzj007()
Dim CXrng As Range, XRrng As Range
Set XRrng = Range("H3")
For Each CXrng In Range("A2:A" & Range("A65536").End(xlUp).Row)
If CXrng.Value <> "" And CXrng.Value = Range("I1").Value Then
XRrng.Resize(1, 5).Value = CXrng.Resize(1, 5).Value
Set XRrng = XRrng.Offset(1, 0)
End If
Next
End Sub

网友(2):

在H3输入=INDEX($A$1:$E$8,MATCH($I$1,$A$1:$A$8,0),MATCH(H2,$A$1:$E$1,0))
然后右拉就行了