the formula doesn't work automatically when change value in another cells

tubrak

Board Regular
Joined
May 30, 2021
Messages
216
Office Version
  1. 2019
Platform
  1. Windows
hi

I have this function works very well
VBA Code:
Function SumSheets(ByVal SheetName As String) As Double
    SumSheets = Application.WorksheetFunction.Sum(Worksheets(SheetName).Range("A1,B1,A2"))
End Function
but when change the values in another cell in another sheet it doesn't work automatically I have to press the formula to run again

and I searched in internet to find solution. nothing succeed so far . i follow for all suggesion from this web site but it doesn't work
hi I have this function works but when change the values in another cell in another sheet it doesn't work automatically I have to press the formula to run again and I searched in internet to find solution. nothing succeed so far . i follow for all suggesion from this web site but it doesn't work any help from experts please?

any help from experts please?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I think most User Defined Functions are not volatile, by default.
See if this makes a difference:
VBA Code:
Function SumSheets(ByVal SheetName As String) As Double
    Application.Volatile
    SumSheets = Application.WorksheetFunction.Sum(Worksheets(SheetName).Range("A1,B1,A2"))
End Function
 
Upvote 0
Solution
You are welcome.
Glad I was able to help!
:)
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,175
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top