Pasting and maintaining cell sizes in excel RRS feed

  • Question

  • Is it possible to paste the contents I have copies into another sheet and maintain the cell sizes?

    I have this:


    Are there options in the Paste function to maintain cell sizes?

    Wednesday, January 15, 2014 8:12 PM

All replies

  • Re:  maintain cell size when pasting


    The column widths can be done when you paste but the row height will have to be separately...
    Sub LookTheSame()
      Dim rng As Excel.Range
      Dim Num As Long

      Set rng = Worksheets(1).Range("B3:D5")
      Worksheets("Sheet3").Range("B3:D5").PasteSpecial Paste:=xlPasteAll
      Worksheets("Sheet3").Range("B3:D5").PasteSpecial Paste:=xlPasteColumnWidths
      Application.CutCopyMode = False

      For Num = 1 To rng.Rows.Count
        Worksheets("Sheet3").Range("B3:D5").Rows(Num).RowHeight = rng.Rows(Num).RowHeight
    End Sub

    Jim Cone
    Portland, Oregon USA (Dropbox)
    (free & commercial excel add-ins & workbooks)

    • Edited by James Cone Tuesday, October 25, 2016 1:29 AM
    Thursday, January 16, 2014 12:16 AM