Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find last used row and paste from above
I've tried various combinations of posted solutions and can't seem to get
what I need to work properly. I have a spreadsheet with one printable page by default. The top 13 rows are headers for any additional pages (A1:L13) and there are rows 14-23 for data entry. I would like to add a button with the option to add additional pages at the bottom of the document and then change the print setup to include this new page as a printable page. It is an easy macro to add just one page but I would like to be able to add any number of pages. Therefore I need to find the last used row and then paste rows 14-23 to the new location below the current page. Thanks for any help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find last used row and paste from above
As ALWAYS, post YOUR code for comments.
-- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... I've tried various combinations of posted solutions and can't seem to get what I need to work properly. I have a spreadsheet with one printable page by default. The top 13 rows are headers for any additional pages (A1:L13) and there are rows 14-23 for data entry. I would like to add a button with the option to add additional pages at the bottom of the document and then change the print setup to include this new page as a printable page. It is an easy macro to add just one page but I would like to be able to add any number of pages. Therefore I need to find the last used row and then paste rows 14-23 to the new location below the current page. Thanks for any help. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find last used row and paste from above
If you want to copy
Range("A14:L23") then use Sheets("COC").Range("A14:L23").Copy ======== Sub CopyRows()' Notice the DOTS Dim Lrow As Long with sheets("COC") Lrow = .Cells(Rows.Count, 1).End(xlUp).Row .Range("A14:L23").Copy .Cells(Lrow + 1, 1) end with End Sub ======= -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... Sorry about that. I've tried many versions but the one I'm starting with is: Sub CopyRows() Dim Lrow As Long 'find last row in Col.A Lrow = Sheets("COC").Cells(Rows.Count, 1).End(xlUp).Row 'copy and paste range Sheets("COC").Range("A14:L23" & Lrow).Copy Destination:=Sheets("COC").Cells(Lrow + 1, 1) End Sub Thanks. "Don Guillett" wrote: As ALWAYS, post YOUR code for comments. -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... I've tried various combinations of posted solutions and can't seem to get what I need to work properly. I have a spreadsheet with one printable page by default. The top 13 rows are headers for any additional pages (A1:L13) and there are rows 14-23 for data entry. I would like to add a button with the option to add additional pages at the bottom of the document and then change the print setup to include this new page as a printable page. It is an easy macro to add just one page but I would like to be able to add any number of pages. Therefore I need to find the last used row and then paste rows 14-23 to the new location below the current page. Thanks for any help. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find last used row and paste from above
Thanks for the help. This works perfectly if there is an entry in a cell but
I have drop-down menus in a few of the columns and I thought it would see that as a used cell even if an item had not been picked from the drop-down menu. As a concept, this is a form that personnel use. If they know that they will need more than the page 1 number of rows, the code will let them add a new page of blank rows (with the drop-down menus there as well). Jeff "Don Guillett" wrote: If you want to copy Range("A14:L23") then use Sheets("COC").Range("A14:L23").Copy ======== Sub CopyRows()' Notice the DOTS Dim Lrow As Long with sheets("COC") Lrow = .Cells(Rows.Count, 1).End(xlUp).Row .Range("A14:L23").Copy .Cells(Lrow + 1, 1) end with End Sub ======= -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... Sorry about that. I've tried many versions but the one I'm starting with is: Sub CopyRows() Dim Lrow As Long 'find last row in Col.A Lrow = Sheets("COC").Cells(Rows.Count, 1).End(xlUp).Row 'copy and paste range Sheets("COC").Range("A14:L23" & Lrow).Copy Destination:=Sheets("COC").Cells(Lrow + 1, 1) End Sub Thanks. "Don Guillett" wrote: As ALWAYS, post YOUR code for comments. -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... I've tried various combinations of posted solutions and can't seem to get what I need to work properly. I have a spreadsheet with one printable page by default. The top 13 rows are headers for any additional pages (A1:L13) and there are rows 14-23 for data entry. I would like to add a button with the option to add additional pages at the bottom of the document and then change the print setup to include this new page as a printable page. It is an easy macro to add just one page but I would like to be able to add any number of pages. Therefore I need to find the last used row and then paste rows 14-23 to the new location below the current page. Thanks for any help. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find last used row and paste from above
I don't understand.
If desired, send your file to my address below along with this msg and a clear explanation of what you want and before/after examples. -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... Thanks for the help. This works perfectly if there is an entry in a cell but I have drop-down menus in a few of the columns and I thought it would see that as a used cell even if an item had not been picked from the drop-down menu. As a concept, this is a form that personnel use. If they know that they will need more than the page 1 number of rows, the code will let them add a new page of blank rows (with the drop-down menus there as well). Jeff "Don Guillett" wrote: If you want to copy Range("A14:L23") then use Sheets("COC").Range("A14:L23").Copy ======== Sub CopyRows()' Notice the DOTS Dim Lrow As Long with sheets("COC") Lrow = .Cells(Rows.Count, 1).End(xlUp).Row .Range("A14:L23").Copy .Cells(Lrow + 1, 1) end with End Sub ======= -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... Sorry about that. I've tried many versions but the one I'm starting with is: Sub CopyRows() Dim Lrow As Long 'find last row in Col.A Lrow = Sheets("COC").Cells(Rows.Count, 1).End(xlUp).Row 'copy and paste range Sheets("COC").Range("A14:L23" & Lrow).Copy Destination:=Sheets("COC").Cells(Lrow + 1, 1) End Sub Thanks. "Don Guillett" wrote: As ALWAYS, post YOUR code for comments. -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff Gross" wrote in message ... I've tried various combinations of posted solutions and can't seem to get what I need to work properly. I have a spreadsheet with one printable page by default. The top 13 rows are headers for any additional pages (A1:L13) and there are rows 14-23 for data entry. I would like to add a button with the option to add additional pages at the bottom of the document and then change the print setup to include this new page as a printable page. It is an easy macro to add just one page but I would like to be able to add any number of pages. Therefore I need to find the last used row and then paste rows 14-23 to the new location below the current page. Thanks for any help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Find to Cut & Paste | Excel Programming | |||
Find/Copy/paste.. then Find/Paste - not working ... at all.... | Excel Programming | |||
Find and Paste | Excel Programming | |||
I need to find a macro to find data cut and paste to another colu. | Excel Programming | |||
Paste value of Find | Excel Programming |