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:

  1. Option Explicit
  2. Sub AccessWorksheetFunction()
  3. MsgBox Application.WorksheetFunction.Text("758", "00000")
  4. End Sub

Description:

a) Line 3 - Worksheet functions can be accessed from VBA by prefixing the actual function with "Application.WorksheetFunction."

Result after Macro execution:

excel vba access worksheet functions

 

You can find similar Excel Questions and Answer hereunder

1) Write to text file without quotes in vba in Excel

2) How can I add a background image to a worksheet?

3) How can I remove Outline from my WorkSheet?

4) How to change desktop background in Excel

5) What is variable scope in VBA, how do variable can be reach from other function or routines in VBA

6) How do I add a symbol like Triangle / Inverted Triangle for indicating trends in a cell using VBA?

7) Vba code to password protect workbook in Excel

8) I have a macro that takes a lot of time for execution - how can I keep the user informed that the macro is running?

9) How can I activate a routine when there is a change in value of a cell?

10) How to add a link in a sheet to another sheet

 

Here the previous and next chapter