![]() |
#1
|
|||
|
|||
![]() I'm trying to copy a named range and paste it two rows below. I want to retain all the source formatting and formulas and include all cells whether they are blank or not. I want to repeat this macro based on the cell value from J5. Here's what I have. Sub Copy_Paste() Dim i As Long For i = 1 To Range("J5") Range("oldroom").Copy Range("A" & Rows.Count).End(xlUp).Offset(2, 0).PasteSpecial xlPasteValues Next i End Sub It won't copy the blank rows. The named range includes 15 rows but it only copy/pastes the first two. The remaining rows have formulas but no values. This macro is supposed to allow the end user to enter a number in J5 to tell how many pages (each "oldroom" should be a page) to add. Additionally, I need the macro to insert a page break between each repeat of the macro. Any ideas? I've successfully tested the above macro by using it on a sheet with a simple 15 row, 3 column table with positive values in all representative cells, but it won't work on my template sheet where there are formulas and zero values aplenty. |
Tags |
add page breaks, copy blanks, repeat macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
tinfanide | Word | 6 | 03-06-2013 12:21 AM |
![]() |
jpol | Excel Programming | 1 | 03-01-2013 05:53 AM |
![]() |
tomlam | Excel Programming | 5 | 12-26-2012 02:20 AM |
![]() |
Marcus | Excel Programming | 8 | 08-17-2012 01:50 AM |
![]() |
Learner7 | Excel | 1 | 04-19-2011 02:45 AM |