Sub 業代客戶編號新客戶()
Application.Run "不重覆"
Application.Run "業代客戶編號新客戶1"
Application.Run "業代客戶編號新客戶2"
Application.Run "業代客戶編號新客戶3"
End Sub
Sub 不重覆()
Sheet1.[P265536].ClearContents
Columns("B:B").AdvancedFilter xlFilterCopy, CopyToRange:=[P1], Unique:=True
End Sub
Sub 業代客戶編號新客戶1()
Sheet1.[X2:Y65536].ClearContents
X = Sheet1.[B65536].End(xlUp).Row
For M = 2 To X
Sheet1.Cells(M, 24) = Sheet1.Cells(M, 2) & Sheet1.Cells(M, 3) & Sheet1.Cells(M, 12)
Next
Columns("X:X").AdvancedFilter xlFilterCopy, CopyToRange:=[Y1], Unique:=True
End Sub
Sub 業代客戶編號新客戶2()
Sheet1.[Z2:Z65536].ClearContents
X = Sheet1.[Y65536].End(xlUp).Row
For M = 2 To X
If Sheet1.Cells(M, 25) Like "*新客戶*" Then
Sheet1.Cells(M, 26) = Mid(Sheet1.Cells(M, 25), 1, 4)
End If
Next
End Sub
Sub 業代客戶編號新客戶3()
Sheet1.[Q265536].ClearContents
X = Sheet1.[P65536].End(xlUp).Row
For M = 2 To X
Sheet1.Cells(M, 17) = Application.CountIf(Sheet1.Range("Z:Z"), Sheet1.Cells(M, 16))
Next
End Sub作者: hcm19522 時間: 2015-12-10 11:44