View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Still Learning Still Learning is offline
external usenet poster
 
Posts: 31
Default Macro fill down question, I think its easy

Sorry for the late reply, since I had the macro insert a column after column
"A" to be used for the formula that will be dragged down, column A will have
data down to the bottom of the sheet.


"Tom Ogilvy" wrote:

Those are good suggestions from mudraker, but that doesn't answer your
question if you don't know how to use it. If you do fine. If not, then
once again I ask what column can be tested to determine the extent of the
data.

--
Regards,
Tom Ogilvy

"mudraker" wrote in
message ...

Here some code that may help you

use 1 of the 3 methods listed to get the LastRow

Dim LastRow As Long



' to get last row before a blank cell
' looking from row 1 in column a
LastRow = Range("A1").End(xlDown).Row


' to get last row before a blank cell
' looking from last row in sheet in column a
LastRow = Cells(Rows.Count, "a").End(xlUp).Row


' get last used row on sheet
LastRow = TheSheet.Cells.Find(what:="*", searchorder:=xlByRows, _
searchdirection:=xlPrevious).Row


' autofill
Range("A3:C" & LastRow).AutoFill _
Destination:=Range("A1:C18"), Type:=xlFillDefault


--
mudraker
------------------------------------------------------------------------
mudraker's Profile:
http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=571560