我目前想知道如何選擇VBA中的範圍,值的範圍,並希望有人可以在下面的一段代碼中提供幫助。定義兩個範圍,然後加入它們
eoline = 50
first = 5
For i = 0 To eoline
multi = 2 * i + 1
a = Cells(first + 1, 1).Select
s1 = Range(Selection, Selection.End(xlDown)).select %select 1st range of values
b = Cells(first + 1, 2 * (i + 1)).Select
s2 = Range(Selection, Selection.End(xlDown)).select %select 2nd range of values
next i
其實我想選擇和複製S1 S2 &,我已經嘗試過失敗
myval = Union(s1, s2).select
selection.copy
感謝
非常感謝您的反饋,因爲看到另一種實現相同任務的方式總是很有趣。 – owner