Created
October 7, 2022 18:38
-
-
Save s-hiiragi/27144fbe1bd0c31c3b0c69937665f91a to your computer and use it in GitHub Desktop.
(Excel VBA) 2つのセル範囲を結合して返すサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 2つのセル範囲を結合する | |
Function JoinRange(x As Range, y As Range) | |
Dim xCnt As Long | |
Dim yCnt As Long | |
Dim i As Long | |
Dim z() | |
xCnt = x.Count | |
yCnt = y.Count | |
ReDim z(xCnt + yCnt - 1, 0) | |
For i = 1 To xCnt | |
z(i - 1, 0) = x(i) | |
Next | |
For i = 1 To yCnt | |
z(xCnt + i - 1, 0) = y(i) | |
Next | |
JoinRange = z | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment