Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtotal Formula Codes 1

Status
Not open for further replies.

APElliott

Technical User
Jul 9, 2002
165
GB
Hello,

I'm trying to compact a workbook and the codes within it, but can't write the following in VB.

I would like a code to say that Sheet "Material" cell j1 'Value' is equal to Subtotal(9,BoQ!O3:O65000).Formula

Any ideas?

And..... I would also like to know how to write the following

Sheet "Material" cell j2 'Value' is equal to Sheet "Material" cell j1 less Subtotal(9,BoQ!O3:O65000).Formula

Thanks,

Andrew [afro]


 
part 1

sheets("Material").range("J1")=application.worksheetfunction.subtotal(9,sheets("BoQ").range("O3:O65000"))

part 2

sheets("Material").range("J2")=sheets("Material").range("J1")-application.worksheetfunction.subtotal(9,sheets("BoQ").range("O3:O65000"))
 
You Beauty [thumbsup2]

I'm just about to give them a whirl!

Thanks,

Andrew [afro]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top