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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a spreadsheet in whixh I wil

Status
Not open for further replies.

bnageshrao

Programmer
Mar 17, 2001
83
US
I have a spreadsheet in whixh I will have some rows of data filled in by end users. Now depending on this I have to update 2 cells. One of the cell should give me a count and the other cell should give me a sum. Is there a way to achieve this using VBA. I can use count and sum function for those 2 cells but the problem is that I cannot lock those cells since I have written vba to do some manipulations. If I protect the sheet and lock the cells the vba I have written will not work and it says that it will not work since the sheet is protected. How do you use the count and sum function using vba.
Thanks
 
to use a worksheet function just type:

Worksheetfunction.(functionname)

example:

mysum = Worksheetfunction.Sum(Activesheet.Range("A2:A5"))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top