VBA for calucation instead row/cell reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

I would like to calculate a range via VBA instead of referencing the
range/cell from the worksheet. How would I write the code in VBA to do the
following formula calculations that are in a cell off to the side from the
data of the worksheet?
=countif(R3:r5000,1)
=subtotal(3, C3:c5000)

In VBA, I have the range/cell reference, but would like to just use the
formula in the code instead of on the worksheet. See below code.

Format(Date, "mmm d, yyyy") & Chr(10) & "Number of Projects in List =" & " "
& Range("w2") _
& Chr(10) & "Assignments: Mike=" & Range("x2")

TIA - Jan
 
Application.Countif(Range("R3:R5000"),1)


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

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