2,464
社区成员
发帖
与我相关
我的任务
分享
Sub Macro1()
'
' Macro1 Macro
Dim rw As Range
Dim i As Integer
For Each rw In Range("A2:F" & Range("A2").End(xlDown).Row)
If rw <> 0 Then
Cells(rw.Row, 8).Value = Cells(rw.Row, 8).Value & Cells(1, rw.Column)
Else
End If
Next
End Sub
Sub 方法一()
Dim rw%
Dim i As Integer
rw = Range("A2").End(xlDown).Row
For j = 2 To rw
For i = 1 To 6
If Cells(j, i) <> 0 Then
Cells(j, 8).Value = Cells(j, 8).Value & Cells(1, i)
Else
Cells(j, 8).Value = Cells(j, 8).Value
End If
Next
Next
End Sub
Sub 方法二()
Dim rw As Range
Dim i As Integer
For Each rw In Range("A2:F" & Range("A2").End(xlDown).Row)
If Cells(rw.Row, rw.Column) <> 0 Then
Cells(rw.Row, 8).Value = Cells(rw.Row, 8).Value & Cells(1, rw.Column)
Else
Cells(rw.Row, 8).Value = Cells(rw.Row, 8).Value
End If
Next
End Sub