vba-在某列上查找数据放回所有的列和行
Dim rngFound As Range Dim strFirst As String Set rngFound = DataMatchSht.Columns("B").Find("CNH MXI", Cells(Rows.Count, "B"), xlValues, xlWhole) If Not rngFound Is Nothing Then strFirst = rngFound.Address Do 'Found a match Debug.Print "Found a match at: " & rngFound.Row & Chr(10) & _ "Value in column C: " & Cells(rngFound.Row, "C").Value & Chr(10) & _ "Value in column D: " & Cells(rngFound.Row, "D").Value Set rngFound = Columns("CNH MXI").Find(strID, rngFound, xlValues, xlWhole) Loop While rngFound.Address <> strFirst End If