Grizzler
asked on
Copy text with formatting VBA Excel
I am importing info from one sheet to another.
The FromSheet has a block of megered cells with text inside. The text is fomatted with some portions in BOLD.
The NewSheet has a similar merged cell arrangement
This Code:
newSheet(destination)=from Sheet(sour ce)
copies text just fine, but loses BOLD formatting.
I have tried
FromSheet(source).copy newSheet(destination)
And
FromSheet(source).copy
newSheet(destination).Past eSpecial
But they both error "cannot change merged cell"
Any ideas????
The FromSheet has a block of megered cells with text inside. The text is fomatted with some portions in BOLD.
The NewSheet has a similar merged cell arrangement
This Code:
newSheet(destination)=from
copies text just fine, but loses BOLD formatting.
I have tried
FromSheet(source).copy newSheet(destination)
And
FromSheet(source).copy
newSheet(destination).Past
But they both error "cannot change merged cell"
Any ideas????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A closer look at the sheets (created by someone else) revealed the source and destination were differrent sizes.... That caused the cannot change merged cell error. I went with your second suggestion and unmerged destination and used this code
impSheet.Range("C23:K28"). Copy mySheet.Range("D25:L30")
Works great!
impSheet.Range("C23:K28").
Works great!
Glad to of help
Thanks
Rob H