-1
Excel vbaの図形からセルを1行ずつ(場合によっては書式付きで)テキストをコピーするにはどうすればよいですか?vbaのテキストから行ごとにテキストをコピーする方法は?
事前に多くのおかげで、次のような
Excel vbaの図形からセルを1行ずつ(場合によっては書式付きで)テキストをコピーするにはどうすればよいですか?vbaのテキストから行ごとにテキストをコピーする方法は?
事前に多くのおかげで、次のような
何かが球場であなたを取得する必要があります。
Sub WriteOutShapeText(shapeName As String)
'get the values from the shape called whatever is stored in shapeName
'and split the text into an array using chr(11) (line feed)
Dim textArray As Variant
textArray = Split(Sheet1.Shapes(shapeName).TextFrame2.TextRange.Characters.Text, Chr(11))
'Set up the row to which we will start writing
Dim writeRow As Integer
writeRow = 1
'Loop through the array assigning each element in textArray to the variable textline
For Each textLine In textArray
'write out to sheet1 column 1 starting at writeRow
Sheet1.Cells(writeRow, 1).Value = textLine
'increment to the next row to which we will write
writeRow = writeRow + 1
Next
End Sub
あなたはVBAでそれを使用することができますlike:
Call WriteOutShapeText("Rectangle 1")
は、 "Rectangle 1"を呼び出す形状に変更し、書き出す範囲をどこにでも変更します。