Thread: Help with Code
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Help with Code

Dim iLastRow As Long
iLastRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("B2").AutoFill Range("B2").Resize(iLastRow - 1)



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Bob" wrote in message
...
Please forgive this elementary question, but I am somewhat new to VBA.

I need to copy the formula in cell B2 to the other cells in column B
starting with cell B3 through to the last row in the worksheet containing
data. The current last row is 900, but it can change over time. (I'm
hoping
there is a VBA property that can return the last data-containing row so
that
I don't have to doing any looping.)

Also, I need to insert code for the aforementioned operation into an
existing subroutine.

Any help would be greatly appreciated. Thanks.
Bob