sayan
sayan

Reputation: 109

Excel VBA - Copy and paste partial formatting

How can I copy and paste a cell from one cell to another that also carries-over formatting on certain texts within the cell using VBA in Excel? For example,

how would I copy "Hello World" so it exactly appears that way in pasted cell?

Thanks!

Upvotes: 0

Views: 293

Answers (2)

0m3r
0m3r

Reputation: 12499

Range.PasteSpecial Method (Excel)

Option Explicit
Sub PasteSpecial()
    'Copy and PasteSpecial a Range
    Range("A1").copy
    Range("A3").PasteSpecial

    Application.CutCopyMode = False

End Sub

Upvotes: 0

Ahmed Elshorbagy
Ahmed Elshorbagy

Reputation: 362

Create macro and record your steps in Excel.Open the macro and view the VBA code

Upvotes: 1

Related Questions