Consulting

Results 1 to 2 of 2

Thread: Subtotal in VBA with counta function

  1. #1

    Subtotal in VBA with counta function

    Hi,

    How would I put this function into a VBA code that looks at column A and puts this function in the cell after the very last cell with any data in it. Assume there are no blanks within the data in column A.

    So I want to find the last row of data in column A and run this formula in the next row down. Furthermore how do I make the ending cell (a14) so it automatically runs the formula to the last cell with data in it.

    =SUBTOTAL(103,'1 yr of PO''s'!$A$2:$A$14)
    Thanks!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
        Range("A2").End(xlDown).Offset(1, 0).FormulaR1C1 = "=SUBTOTAL(103, '1 yr of PO''s'!R2C:R[-1]C)"
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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