stuck on final prat of spreadsheet "macro copying cells"

  • Thread starter Thread starter alan_bourne
  • Start date Start date
A

alan_bourne

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
+----------------------------------------------------------------
 
Try this :-

'------------------------------------------------
Dim LastCell As Range
Set LastCell = ActiveSheet.Range("D65536").End(xlUp)
LastCell.Copy Destination:=LastCell.Offset(1, 0)
'----------------------------------------------------
 
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.
 
Back
Top