Carlos Arronte Bello
Carlos Arronte Bello

Reputation: 429

Special paste in Excel with VBA

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:

''CUSTOM MESSAGE 
Sheets("Extract").Range("AI" & sourceRow & "").Copy Destination := 
Sheets("Print").Range("H" & destRow + 7 & "")

The result of this code is:

Actual

But I need something like this:

Needed

As you can see, I need to change to the next row, before going out of the table. Any idea?

Upvotes: 0

Views: 90

Answers (2)

Robby
Robby

Reputation: 827

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

Upvotes: 2

BruceWayne
BruceWayne

Reputation: 23285

The format of the Range() is incorrect.

Try:

Sheets("Extract").Range("AI" & sourceRow).Copy Sheets("Print").Range("H" & destRow + 7)

Upvotes: 1

Related Questions