Sub TATAL()
Application.Run "TATAL4"
Application.Run "TATAL5"
Application.Run "TATAL6"
End Sub
Sub TATAL4()
Sheet2.[A2:A65536].ClearContents
X = Sheet4.[B65536].End(xlUp).Row
Y = Sheet2.[A65536].End(xlUp).Row
For M = 2 To X
If Not (Sheet4.Cells(M, 2) = "" Or Sheet4.Cells(M, 2) = " ") Then
Sheet2.Cells(Y + 1, 1) = Sheet4.Cells(M, 2)
Y = Y + 1
End If
Next
End Sub
Sub TATAL5()
X = Sheet5.[B65536].End(xlUp).Row
Y = Sheet2.[A65536].End(xlUp).Row
For M = 2 To X
If Not (Sheet5.Cells(M, 2) = "" Or Sheet5.Cells(M, 2) = " ") Then
Sheet2.Cells(Y + 1, 1) = Sheet5.Cells(M, 2)
Y = Y + 1
End If
Next
End Sub
Sub TATAL6()
X = Sheet6.[B65536].End(xlUp).Row
Y = Sheet2.[A65536].End(xlUp).Row
For M = 2 To X
If Not (Sheet6.Cells(M, 2) = "" Or Sheet6.Cells(M, 2) = " ") Then
Sheet2.Cells(Y + 1, 1) = Sheet6.Cells(M, 2)
Y = Y + 1
End If
Next
End Sub作者: jcchiang 時間: 2020-10-19 14:06
試試看
Sub ex()
Sheets(2).[A2:A65536].ClearContents
Y = Sheets(2).[A65536].End(xlUp).Row
For R = 4 To Worksheets.Count
X = Sheets(R).[B65536].End(xlUp).Row
For M = 2 To X
If Not (Sheets(R).Cells(M, 2) = "" Or Sheets(R).Cells(M, 2) = " ") Then
Sheets(2).Cells(Y + 1, 1) = Sheets(R).Cells(M, 2)
Y = Y + 1
End If
Next
Next
End Sub作者: rouber590324 時間: 2020-10-19 16:56