The VBA LOG function is listed under the math category of VBA functions. When you use it in a VBA code, **it returns the logarithm of the number you supplied**. The logarithm is a mathematical calculation that is the inverse function of exponentiation. You can learn more about this calculation from here.

## Syntax

**Log(Number)**

## Arguments

**Number**: The number for which you want to calculate the natural logarithm.

## Example

To practically understand how to use VBA LOG function, you need to go through the below example where we have written a vba code by using it:

```
Sub example_FILTER()
Range("B1").Value = Log(Range("A1"))
End Sub
```

In the above code, we have used the LOG to get the natural logarithm of the number we have in the cell A1 and it has returned 2.70805020110221 in the cell B1 as a result.

## Notes

- If the supplied number is less than or equals to 0 then VBA will return a run-time 5 error.
- If the value specified is a value other than a number or a number that canâ€™t be recognized as a number, VBA will return the run-time 13 error.

## Related Functions

ABS | ATN | COS | EXP | FIX | INT | RND | ROUND | SGN | SIN | SQR | TAN