Skip to main content

Worksheet.Calculate event

Table of contents
  1. Syntax
  2. Return value
  3. Example

Occurs after the worksheet is recalculated for the Worksheet object.

Syntax

expression.Calculate

expression A variable that represents a Worksheet object.

Return value

Nothing

Example

This example adjusts the size of columns A through F whenever the worksheet is recalculated.

Private Sub Worksheet_Calculate()
    Columns("A:F").AutoFit
End Sub

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>