Get a month of TabletWise Pro for free! Click here to redeem

Worksheet Events - Worksheet Calculate Event

3 minutes
Share the link to this page
You need to purchase the class to view this lesson.
One-time Purchase
List Price:  $139.99
You save:  $40
List Price:  د.إ514.18
You save:  د.إ146.92
List Price:  A$200.99
You save:  A$57.43
List Price:  ৳11,866.71
You save:  ৳3,390.73
List Price:  CA$190.20
You save:  CA$54.34
CHF 94.14
List Price:  CHF 131.80
You save:  CHF 37.66
List Price:  kr923.82
You save:  kr263.96
List Price:  €123.99
You save:  €35.42
List Price:  £111.45
You save:  £31.84
List Price:  HK$1,084.93
You save:  HK$310
List Price:  ₹10,477.20
You save:  ₹2,993.70
List Price:  RM598.38
You save:  RM170.98
List Price:  ₦54,246.12
You save:  ₦15,500
List Price:  kr1,324.07
You save:  kr378.33
List Price:  NZ$213.40
You save:  NZ$60.97
List Price:  ₱6,939.32
You save:  ₱1,982.80
List Price:  ₨23,350.33
You save:  ₨6,672
List Price:  S$195.06
You save:  S$55.73
List Price:  ฿4,367.55
You save:  ฿1,247.96
List Price:  ₺959.76
You save:  ₺274.23
List Price:  R2,396.08
You save:  R684.64
Already have an account? Log In


Hey guys, welcome back. So in this video we're going to discuss calculate event. So the calculate event happens when you just calculate the values in your worksheet and the values get calculated whenever you change yourself, okay? And actually, this happens for the whole workbook, not just this particular sheet, however you're doing the event for for that particular sheet. So we are on a sheet called calculate event. And I've got some random numbers here in in these cells, okay?

And they are being generated by a function called run between. So this function will recalculate each time I changed the value of any other cell, okay, or any cell actually in the workbook. So if I just change the value of a cell numbers, recalculate, okay, and now I'm also going to show you how you can calculate a sheet or a workbook as well so you can go to the Formulas tab on the ribbon, click on calculate sheet and this will calculate your sheet. If you click on calculate now, the would calculate your entire workbook, which includes your sheet as well. I don't typically have a lot of uses for the for this event, like, I probably have never needed to use it. But in case you need it, it's there.

Okay, I'll show you as well, the example that Microsoft has on their websites. Okay, so this is the example that Microsoft has on their website. So it's actually just to autofit the columns A to F, whenever you do a calculation for the worksheet. It's not particularly you know, the best but we will try it. So I'm gonna right click on the calculate event worksheet here, click on View code, and then I'm gonna go to worksheet and select the calculate event. Okay?

And now we are in the worksheet calculate event. Okay? And now let's run this. Let's run this event. So I'm just going to change the value of any cell and this event will run you can see here that columns A to F have had an auto fitting, this is similar to selecting the columns here and double clicking on them and this will do the auto fitting and also there is a recalculation done. Okay.

And this will trigger your calculate event as well. And one thing I want to tell you as well, which is some sort of a word of caution, you know, this event will run whenever you do any sort of calculation on your workbook, okay? Because your workbook will recalculate for any cell that you change the value of, Okay, so this event will get triggered a lot. Okay, so if you've got some sort of any looping code, you know, any code that will take time to execute any code that has lots of actions, okay, this could slow down your workbook. I haven't needed to use it, but if there is a use for that event for you, I would be interested to know it basically. Okay.

So Thank you very much for watching this video. I'll see you on the next

Sign Up