Cos VBA function – How to calculate the cosine

1. Cos VBA function – Description

The Cos VBA function   returns the cosine value. We should use this function to calculate the cosine value. For example, the cosine of 0 is equal to 1.

2. VBA Cos function – Syntax

'datatalk.pl
Cos (Number As Double) As Double

Number : The number we want to calculate exponential for.

Function return : Double / numeric value.

3. VBA Cos function Example

How to use the Cos  function  in VBA Excel? Below are examples of using the Cos function in the VisualBasic Editor.

Example 1 : An example of using the Cos VBA function – result in the MsgBox window.

'datatalk.pl
Dim dblNumber As Double
dblNumber = 0
MsgBox Cos (dblNumber)

Example 2 : VBA Cos – function example – result in an Excel sheet.

'datatalk.pl
Dim dblNumber2 As Double
dblNumber2 = 0
Range ("A1") = Cos (dblNumber2)
Excel VBA functions - Cos VBA function
Excel VBA functions – Cos VBA function

4. VB Cos function – Additional information

  • lack

5. Cos VisualBasic function – Where to use?

The function can be used in: Excel 2003, Excel 2007, Excel 2010, Excel 2013, Excel 2016.

The article is part of the VBA Excel function list. You can find a list of all VBA functions at this address:  VBA functions .

Leave a comment

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

%d bloggers like this: