ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   stuck on final prat of spreadsheet "macro copying cells" (https://www.excelbanter.com/excel-programming/282724-stuck-final-prat-spreadsheet-macro-copying-cells.html)

alan_bourne[_18_]

stuck on final prat of spreadsheet "macro copying cells"
 

I have been working on this one for a while and finaly come to the en
of my spreadsheet i need to create a macro which copys the last cell i
the D column but it needs drag the forumla down one cell. the onl
problem is its at the bottom of an auto filter and im finding it ver
hard to get to grips with any help would be great

thanks very much

Alan Bourne

i have attached the single page including the auto filte

+----------------------------------------------------------------
| Attachment filename: help.xls
|Download attachment: http://www.excelforum.com/attachment.php?postid=360692
+----------------------------------------------------------------

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


BrianB

stuck on final prat of spreadsheet "macro copying cells"
 

Try this :-

'------------------------------------------------
Dim LastCell As Range
Set LastCell = ActiveSheet.Range("D65536").End(xlUp)
LastCell.Copy Destination:=LastCell.Offset(1, 0)
'----------------------------------------------------


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/


Tom Ogilvy

stuck on final prat of spreadsheet "macro copying cells"
 
Just a word of caution:
Assuming the autofilter is in effect and only some of the rows are visible,
Unless the last row of the autofilter is visible, the recommended code will
overwrite some of your existing data. If all the rows are visible or at
least the last row is visible, then it should work.

--
Regards,
Tom Ogilvy




"BrianB" wrote in message
...

Try this :-

'------------------------------------------------
Dim LastCell As Range
Set LastCell = ActiveSheet.Range("D65536").End(xlUp)
LastCell.Copy Destination:=LastCell.Offset(1, 0)
'----------------------------------------------------


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/




alan_bourne[_19_]

stuck on final prat of spreadsheet "macro copying cells"
 

nice one will do thanks alo

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


alan_bourne[_20_]

stuck on final prat of spreadsheet "macro copying cells"
 

works a treat thanks for your hel

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com



All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com