Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding the last cell used in a file...

Hello all,

I need to copy a formula in B2 to all cells below it in column B.
However, thus far, I haven't been able to locate the last used row i
the file. I have copied the formula all the way to B65536. How do
only copy it to the last row of the workbook?

Any help would be much appreciated.

Thanks,

Trevo

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Finding the last cell used in a file...

Something like:

With ActiveSheet
.Range("B2").Copy .Range(.Range("B3"), .Range("B" & _
.UsedRange.Row + .UsedRange.Rows.Count - 1))
End With

--

Vasant



"Jesterhoz " wrote in message
...
Hello all,

I need to copy a formula in B2 to all cells below it in column B.
However, thus far, I haven't been able to locate the last used row in
the file. I have copied the formula all the way to B65536. How do I
only copy it to the last row of the workbook?

Any help would be much appreciated.

Thanks,

Trevor


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Finding the last cell used in a file...

Trevor,

Here is an example

Range("B2").AutoFill Destination:=Range("B2").Resize(Cells(Rows.Count,
"B").End(xlUp).Row, 1)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jesterhoz " wrote in message
...
Hello all,

I need to copy a formula in B2 to all cells below it in column B.
However, thus far, I haven't been able to locate the last used row in
the file. I have copied the formula all the way to B65536. How do I
only copy it to the last row of the workbook?

Any help would be much appreciated.

Thanks,

Trevor


---
Message posted from http://www.ExcelForum.com/



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
Finding of temp file KC Excel Discussion (Misc queries) 4 May 12th 09 03:10 AM
finding where a file is stored Catherine New Users to Excel 6 April 26th 09 10:28 PM
Finding a temp file Kevin Excel Discussion (Misc queries) 3 June 9th 08 09:02 PM
finding a file Q Excel Discussion (Misc queries) 1 May 7th 06 10:56 AM
Finding the cell that is linked to a file kosciosco Excel Discussion (Misc queries) 2 October 6th 05 06:36 PM


All times are GMT +1. The time now is 02:22 AM.

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

About Us

"It's about Microsoft Excel"