Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Copy and Paste LAST ROW of data: non-contiguous Row, contiguous Column

Hi All,

I would like a solution to copy the last row of data on multiple worksheets
(within the same workbook) to the next blank row of the individual worksheet
(Sheet1 copy last row of data to next blank row on Sheet1, Sheet3 copy last
row of data to next blank row on Sheet3 etc). The sheets will not be
sequentially named and the number of rows on each sheet will vary.

The row of data will be non-contiguous (one or more blank cells) in the row
and it will contain constants as well as formulae; the column will be
contiguous data, apart from a few blank rows before the start of the
contiguous column data.

Thanks
Sam

--
Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Copy and Paste LAST ROW of data: non-contiguous Row, contiguous Column

Sounds like you are entering data in a list. I would just use Data|Form to
enter a new row of data. All cells above the new row that have formulas
will automatically be copied down. To copy a cell from the row above that
has a constant in it, press Ctrl+; (Ctrl+ semicolon) while in that field.

--
Regards,
Bill Renaud



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Copy and Paste LAST ROW of data: non-contiguous Row, contiguous Column

Hi Bill,

Thank you for reply. Because of the numerous worksheets involved a VBA
solution would be more suitable.

Cheers,
Sam

Bill Renaud wrote:
Sounds like you are entering data in a list. I would just use Data|Form to
enter a new row of data. All cells above the new row that have formulas
will automatically be copied down. To copy a cell from the row above that
has a constant in it, press Ctrl+; (Ctrl+ semicolon) while in that field.


--
Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Copy and Paste LAST ROW of data: non-contiguous Row, contiguous Column

The following routine will copy the last row on ALL worksheets in the
active workbook, so you can put this macro in any workbook you want and use
it across multiple workbooks. It copies the entire cell contents, formulas,
formats, comments and all.

Public Sub CopyLastRowAllSheets()
Dim ws As Worksheet
Dim rngLastRow As Range

For Each ws In ActiveWorkbook.Worksheets
With ws.UsedRange
Set rngLastRow = .Resize(1).Offset(.Rows.Count - 1)
End With

With rngLastRow
.Copy Destination:=.Offset(1)
End With
Next ws
End Sub

--
Regards,
Bill Renaud



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Copy and Paste LAST ROW of data: non-contiguous Row, contiguous Column

Hi Bill,

Thank you very much for further assistance.

Your treatment of the rows is fine. Unfortunately, I have a problem with the
column. I require a copy process that can copy a column of contiguous data,
that has a few blank rows before the start of the contiguous column data and
excludes any data after the contiguous block separated by a blank cell in the
column (data below the contiguous block separated by blank cells should not
be copied).

Also, only specific worksheets in the workbook should be copied, not all.

Further assistance very much appreciated.

Cheers,
Sam

Bill Renaud wrote:
The following routine will copy the last row on ALL worksheets in the
active workbook, so you can put this macro in any workbook you want and use
it across multiple workbooks. It copies the entire cell contents, formulas,
formats, comments and all.


Public Sub CopyLastRowAllSheets()
Dim ws As Worksheet
Dim rngLastRow As Range


For Each ws In ActiveWorkbook.Worksheets
With ws.UsedRange
Set rngLastRow = .Resize(1).Offset(.Rows.Count - 1)
End With


With rngLastRow
.Copy Destination:=.Offset(1)
End With
Next ws
End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200711/1



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Copy and Paste LAST ROW of data: non-contiguous Row, contiguous Column

Sam wrote:
<<I require a copy process that can copy a column of contiguous data, that
has a few blank rows before the start of the contiguous column data and
excludes any data after the contiguous block separated by a blank cell in
the column (data below the contiguous block separated by blank cells should
not be copied).

Also, only specific worksheets in the workbook should be copied, not all.

Can you be more specific about what you need?

--
Regards,
Bill Renaud



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
Copy and Paste LAST ROW of data non-contiguous Sam via OfficeKB.com Excel Programming 6 October 29th 07 02:28 PM
xldown in a non-contiguous column David Gerstman Excel Programming 7 November 8th 06 05:25 PM
Paste Data into Contiguous (Visible) Cells trev_sk8r New Users to Excel 1 June 16th 06 10:04 PM
add all contiguous numbers-column-row Bernard Liengme New Users to Excel 0 May 2nd 06 02:02 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM


All times are GMT +1. The time now is 10:15 AM.

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

About Us

"It's about Microsoft Excel"