Created
April 7, 2017 13:58
-
-
Save katogiso/7269437cb0552d2eb4482bcfe82e9340 to your computer and use it in GitHub Desktop.
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
Sub Pack() | |
Dim a() As String ' 文字列を入れる配列 | |
Dim index As Integer ' 有効なセルの個数 | |
index = 0 | |
For Each c In ThisWorkbook.Sheets("Source").Range("B1:B10") | |
If c <> "" Then | |
ReDim Preserve a(index) ' 必要な配列を確保する | |
a(index) = c | |
index = index + 1 | |
End If | |
Next c | |
ThisWorkbook.Sheets("Target").Range(Cells(1, 1), Cells(1, index)) = a | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment