Vba access worksheet functions in Excel
For example, I understand that the TEXT function I use in Worksheet to display a number in specific format is not available in VBA. Is there any way I can still use this function in VBA?
To do it in Excel, here is the answer:
- Option Explicit
- Sub AccessWorksheetFunction()
- MsgBox Application.WorksheetFunction.Text("758", "00000")
- End Sub
a) Line 3 - Worksheet functions can be accessed from VBA by prefixing the actual function with "Application.WorksheetFunction."
Result after Macro execution: