Link to home
Start Free TrialLog in
Avatar of Grizzler
GrizzlerFlag for United States of America

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)=fromSheet(source)

copies text just fine, but loses BOLD formatting.
I have tried

FromSheet(source).copy newSheet(destination)

And

FromSheet(source).copy
newSheet(destination).PasteSpecial

But they both error "cannot change merged cell"

Any ideas????


 

Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Try doing Activesheet.Paste rather than PasteSpecial.

Thanks
Rob H
ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Grizzler

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!
Glad to of help