Copy Past with macro

  • Thread starter Murat D. Hekimoðlu
  • Start date
M

Murat D. Hekimoðlu

Hello all,

I copy a Range and then paste it into new excel workbook. Duiring this
action I use the below code. I can pastespecial the column widths but cant
paste the Row Height. Is there any possibility that I can copy the
RowHeights too??

Sheets(1).Range("A1").PasteSpecial Paste:=xlValues
Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteFormats
Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteRowHeight ?????????
 
J

Jim Rech

Height. Is there any possibility that I can copy the
RowHeights too??

Not through Paste Special. You'd have to capture the row height and then
set it explicitly:

Sub a()
Dim RowHt As Single
RowHt = Range("A1").RowHeight
''Later...
Range("A10").RowHeight = RowHt
End Sub


--
Jim
| Hello all,
|
| I copy a Range and then paste it into new excel workbook. Duiring this
| action I use the below code. I can pastespecial the column widths but cant
| paste the Row Height. Is there any possibility that I can copy the
| RowHeights too??
|
| Sheets(1).Range("A1").PasteSpecial Paste:=xlValues
| Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteFormats
| Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
| Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteRowHeight ?????????
|
| --
| thanx
|
| Murat Demir HEKÝMOÐLU
| have a nice day!
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top