Consulting

Results 1 to 3 of 3

Thread: Solved: End(xlUp).Row).FillDown formula

  1. #1
    VBAX Regular
    Joined
    Apr 2006
    Posts
    32
    Location

    Solved: End(xlUp).Row).FillDown formula

    A big hey from TX,

    Is there a way to use a FillDown formula, similar to the one below, if the current cell is not known? Here is my scenario: [vba]Range("A8").Select
    Cells.Find(What:="PRODUCT", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False).Activate
    ActiveCell.Offset(1, 10).Activate
    ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-4]"
    Range("K8:K" & Cells(Rows.Count, "J").End(xlUp).Row).FillDown
    ActiveSheet.UsedRange[/vba] The FillDown formula listed above is one that I use consistantly when I know the activecell address. Is there a way to replace "K8:K" using ActiveCell or something else that would allow me to fill down the formula to the last cell in Column J? Or is there another non cell specific FillDown formula? The distance between ActiveCell and the end of Column J always varies.

    I would really appreciate anyone's help on this.

    R1C1
    Last edited by R1C1; 04-10-2006 at 08:24 PM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]
    ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-4]"
    Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column - 1).End(xlUp)).FillDown
    [/vba]

  3. #3
    VBAX Regular
    Joined
    Apr 2006
    Posts
    32
    Location
    Thank you xld. Works great, but I knew that you knew that, but you did not know that I knew that you knew that, thanks for knowing. Now the newbie knows.

    Master

    Mark this one solved!

    R1C1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •