I'm working on Excel with VBA. I need to copy and paste some information from one row to and specific destination. I'm using this code:
我正在使用VBA处理Excel。我需要将一些信息从一行复制并粘贴到特定目的地。我正在使用此代码:
''CUSTOM MESSAGE
Sheets("Extract").Range("AI" & sourceRow & "").Copy Destination :=
Sheets("Print").Range("H" & destRow + 7 & "")
The result of this code is:
这段代码的结果是:
But I need something like this:
但是我需要这样的东西:
As you can see, I need to change to the next row, before going out of the table. Any idea?
如您所见,我需要在离开桌子之前更改到下一行。任何想法?
2 个解决方案
#1
2
Can you wrap the text in that cell? Something like this?
你可以在那个单元格中包装文本吗?像这样的东西?
Sheets("Extract").Range("AI" & sourceRow).Copy Sheets("Print").Range("H" & destRow + 7).WrapText = True
#2
1
The format of the Range()
is incorrect.
Range()的格式不正确。
Try:
Sheets("Extract").Range("AI" & sourceRow).Copy Sheets("Print").Range("H" & destRow + 7)
#1
2
Can you wrap the text in that cell? Something like this?
你可以在那个单元格中包装文本吗?像这样的东西?
Sheets("Extract").Range("AI" & sourceRow).Copy Sheets("Print").Range("H" & destRow + 7).WrapText = True
#2
1
The format of the Range()
is incorrect.
Range()的格式不正确。
Try:
Sheets("Extract").Range("AI" & sourceRow).Copy Sheets("Print").Range("H" & destRow + 7)