Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Find last used row and paste from above

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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Find to Cut & Paste Mark P Excel Programming 4 March 24th 09 04:26 PM
Find/Copy/paste.. then Find/Paste - not working ... at all.... [email protected] Excel Programming 9 November 30th 06 08:49 PM
Find and Paste Ronbo Excel Programming 5 April 1st 06 03:20 AM
I need to find a macro to find data cut and paste to another colu. Rex Excel Programming 6 December 7th 04 09:22 AM
Paste value of Find John Keturi Excel Programming 5 October 16th 04 11:44 PM


All times are GMT +1. The time now is 05:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"