像这样吗?
debug.print将把每个循环的结果打印到开发人员的直接窗口中。
Sub MyConcat()
Dim RefExc As String
Dim c As Range
Dim x As Long
For Each c In Sheet1.Range("L2:L10")
If c.Value = -2 Then
For x = 6 To 73
If x <> 71 Then RefExc = RefExc & ", " & Sheet1.Cells(c.Row, x)
Next x
Debug.Print RefExc
End If
Next c
End Sub
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句