entering formula using variable in Excel Macro

  • Thread starter Thread starter doc-s
  • Start date Start date
D

doc-s

Trying to use following in excel Macro and it will not
work. Any help????

ActiveCell.Formula = "=SUBTOTAL(9,P & rowval -1: P &
rowval1)"


where P is column and rowval -1 is current row -1 and
rowval1 are variables.
 
Hi
try:
ActiveCell.Formula = "=SUBTOTAL(9,P" & rowval -1 & ":P" &
rowval1 & ")"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top