stuck on final prat of spreadsheet "macro copying cells"

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
+----------------------------------------------------------------
 
B

BrianB

Try this :-

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

Tom Ogilvy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top