What is Caller in Excel Add-in? VBA (Visual Basic for Applications)

What is Caller in Excel Add-in? VBA (Visual Basic for Applications)

Caller

User Defined Function in Excel VBA (Visual Basic for Application). Application.Caller.Text: Returns information by directing the flow that how a code or UDF (User Defined Function) was called. Caller represents cell reference which is a Range object in Excel hence, we can retrieve all the properties of a cell like below:

Code example

With Application.Caller
	CallerRows = .Rows.Count
	CallerCols = .Columns.Count
	CallerAddr = .Address
End With

Get Caller Address

Public Sub GetCallerAddress()
	MsgBox Application.Caller.Address
End Sub

Get Caller Cell Value

Public Sub GetCallerValue()
	MsgBox Application.Caller.Text
End Sub

Next >> User Defined Functions

Leave a Reply

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