問題:總共有六欄項目(G~L),每欄各有3~8項不等資料,想要做C6取2、C6取3、C6取4、C6取5、C6取6寫了C6取2,卡在不知道如何排除重複的資料....有請大神指點迷津...
檔案下載:https://ufile.io/3b9hj7ir
Sub oneAoneC()
Dim Ante1 As Range
Dim 組合結果 As Range
Dim xStr As String
Dim xFN1, xFN2, xFN3 As Integer
Dim xSV1, xSV2, xSV3 As String
Worksheets("工作表").Activate
Set Ante1 = Range("A2:A34") '常消費時段
xStr = "-" 'Separator
Set 組合結果 = Range("E2")
For xFN1 = 1 To Ante1.Count
xSV1 = Ante1.Item(xFN1).Text
For xFN2 = 1 To Ante1.Count
xSV2 = Ante1.Item(xFN2).Text
組合結果.Value = xSV1 & xStr & xSV2
Set 組合結果 = 組合結果.Offset(1, 0)
Next
Next
End Sub
相似问题