*Create UDF like method, or I can say an UDF without VBA in Excel, and convert an excel formula to VBA code are two different issues.*

Let me take one by one.

**1. UDF without VBA:**

Yes is possible, and you can do this by using NAMED RANGE method.

**How it works:**

- Write the formula in cell you want to use.
- Select the cell.
- Now to get the Name Manager either use
**Ctrl+F3** or from FORMULA tab, hit the Name Manager.
- Click on New then assign an appropriate Name to the cell, and finish with Ok.

*Now you can use that name as an UDF, Excel will use that formula.*

**Remember this works with simple and straight forward Formula only.**

**2. Convert Excel Formula to VBA Code:**

*This method should consider as how to use Excel formula with/as/through VBA code.*

There are many methods, few I would like to show here.

```
Range("G2").Formula = "=IFERROR(VLOOKUP(A1,$A$5:$E$25,2,FALSE),"")
```

This assigns a formula to the cell `G2`

.

```
X = Application.WorksheetFunction.IFERROR(VLOOKUP(A1,$A$5:$E$25,2,FALSE),"")
```

- This assigns formula to the variable
`X`

.

**N.B.**

*Formula used above are editable.*

*You may refer Microsoft website for further assistance.*