VBA Procedure Calls

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • IdentifierName [arguments]
  • Call IdentifierName[(arguments)]
  • [Let|Set] expression = IdentifierName[(arguments)]
  • [Let|Set] IdentifierName[(arguments)] = expression

Parameters

ParameterInfo
IdentifierNameThe name of the procedure to call.
argumentsA comma-separated list of arguments to be passed to the procedure.

Remarks

The first two syntaxes are for calling Sub procedures; notice the first syntax involves no parentheses.

See This is confusing. Why not just always use parentheses? for a thorough explanation of the differences between the first two syntaxes.

The third syntax is for calling Function and Property Get procedures; when there are parameters, the parentheses are always mandatory. The Let keyword is optional when assigning a value, but the Set keyword is required when assigning a reference.

Fourth syntax is for calling Property Let and Property Set procedures; the expression on the right-hand side of the assignment is passed to the property's value parameter.



Got any VBA Question?