View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave D-C Dave D-C is offline
external usenet poster
 
Posts: 13
Default copy / paste formula to last row

tnriverfish wrote:
My spreadsheet has separate formulas in AC1 through AN1 and I would
like to essencially drag that formulas down through the last row that
has any data in it.
The formulas would have to adjust like a regular drag down. Any help
would be appreciated.


How about:
Sub sub1()
Dim irow99&, icol99%
ActiveSheet.UsedRange ' to get the last row, column
irow99 = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell) .Row
icol99 = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell) .Column
ActiveSheet.Range("AC1:AN1").Copy _
ActiveSheet.Range("AC1:AN1").Resize(irow99)
End Sub



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---