Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: writing formula in VBA

  1. #1


    Here is an extract of some code which is trying to insert the word "TOTALS" into a cell whose position can change (Hence the variable TotalRow). This part works!

    However I'm also tring to insert a formula in the same row starting in Col N as far over as AH.

    Please help me. Thank you

    Range("M" & TotalRow).Value = "TOTALS"

    Range("N" & TotalRow, ("AH" & TotalRow)).Formula = "=SUBTOTAL(9, "N2:N" & LastRow)"

  2. #2


    Try using the macro recorder to get the required code.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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