简体   繁体   中英

Excel VBA Copy Paste Values only( xlPasteValues ) on same columns

I have this code

    Sheets("Main").Columns("H:S").Copy
    Sheets("Main").Columns("H:S").PasteSpecial xlPasteValues

It is not working, but manually works very well. What is problem?

Runtime error 1004 Says what copy size differs from paste size

Recorded macro also got same error on repeat, there are no merged cells and filters, no hidden rows and columns

不同的方法...

With Sheets("Main").Columns("H:S") .Value = .Value End With

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM