You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Language/Reference/User-Interface-Help/atn-function.md
+4-17
Original file line number
Diff line number
Diff line change
@@ -24,29 +24,16 @@ The required _number_ [argument](../../Glossary/vbe-glossary.md#argument) is a [
24
24
25
25
The **Atn** function takes the ratio of two sides of a right triangle (_number_) and returns the corresponding angle in radians. The ratio is the length of the side opposite the angle divided by the length of the side adjacent to the angle.
26
26
27
+
> [NOTE!]
28
+
> This is the equivalent of the **ATAN()** function in Excel. Oddly, **Excel.WorksheetFunctions.ATAN()** does not exist (as with other Excel formula functions). You can instead use this VBA **Atn()** function.
29
+
27
30
The range of the result is **-**[pi](../../Glossary/vbe-glossary.md#pi)/2 to pi/2 radians. To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi.
28
31
29
32
> [!NOTE]
30
33
> **Atn** is the inverse trigonometric function of **[Tan](tan-function.md)**, which takes an angle as its argument and returns the ratio of two sides of a right triangle. Do not confuse **Atn** with the cotangent, which is the simple inverse of a tangent (1/tangent).
31
34
32
-
33
-
## Example
34
-
35
-
This example uses the **Atn** function to calculate the value of pi.
36
-
37
-
38
-
```vb
39
-
DimIntVar,StrVar,DateVar,MyCheck
40
-
' Initialize variables.
41
-
IntVar=459:StrVar="Hello World":DateVar=#2/12/69#
42
-
MyCheck=VarType(IntVar)' Returns 2.
43
-
MyCheck=VarType(DateVar)' Returns 7.
44
-
MyCheck=VarType(StrVar)' Returns 8.
45
-
46
-
```
47
-
48
35
## See also
49
36
50
37
-[Functions (Visual Basic for Applications)](../functions-visual-basic-for-applications.md)
51
38
52
-
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
39
+
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
Copy file name to clipboardexpand all lines: Language/Reference/User-Interface-Help/copyfile-method.md
+6
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,12 @@ If _source_ contains wildcard characters, or _destination_ ends with a path sepa
58
58
59
59
An error also occurs if a _source_ using wildcard characters doesn't match any files. The **CopyFile** method stops on the first error it encounters. No attempt is made to roll back or undo any changes made before an error occurs.
60
60
61
+
Files copied to a new destination path will keep the same file name. To rename the copied file, simply include the new file name in the destination path. For example, this will copy the file to a new location _and_ the file in the new location will have a different name:
Copy file name to clipboardexpand all lines: Language/Reference/User-Interface-Help/variant-data-type.md
+2
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ The **Variant** data type has no [type-declaration character](../../Glossary/vbe
18
18
19
19
A **Variant** is a special data type that can contain any kind of data except fixed-length [String](../../Glossary/vbe-glossary.md#string-data-type) data. (**Variant** types now support [user-defined types](../../Glossary/vbe-glossary.md#user-defined-type).) A **Variant** can also contain the special values [Empty](../../Glossary/vbe-glossary.md#empty), **Error**, **Nothing**, and [Null](../../Glossary/vbe-glossary.md#null). You can determine how the data in a **Variant** is treated by using the **VarType** function or **TypeName** function.
20
20
21
+
Use the [VarType function](https://docs.microsoft.com/office/vba/language/reference/user-interface-help/vartype-function) to test what type of data is held in a Variant.
22
+
21
23
Numeric data can be any integer or real number value ranging from -1.797693134862315E308 to -4.94066E-324 for negative values and from 4.94066E-324 to 1.797693134862315E308 for positive values.
22
24
23
25
Generally, numeric **Variant** data is maintained in its original data type within the **Variant**. For example, if you assign an [Integer](../../Glossary/vbe-glossary.md#integer-data-type) to a **Variant**, subsequent operations treat the **Variant** as an **Integer**. However, if an arithmetic operation is performed on a **Variant** containing a [Byte](../../Glossary/vbe-glossary.md#byte-data-type), an **Integer**, a [Long](../../Glossary/vbe-glossary.md#long-data-type), or a [Single](../../Glossary/vbe-glossary.md#single-data-type), and the result exceeds the normal range for the original data type, the result is promoted within the **Variant** to the next larger data type. A **Byte** is promoted to an **Integer**, an **Integer** is promoted to a **Long**, and a **Long** and a **Single** are promoted to a [Double](../../Glossary/vbe-glossary.md#double-data-type).
Copy file name to clipboardexpand all lines: README.md
+13-1
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,16 @@
1
+
# About VBA-docs repo
2
+
We no longer have resources to respond to new issues. We welcome PRs that include documentation fixes, code samples, or improved comments. Please create a branch, make your changes, then open a PR to merge your change to master. We try to review new PRs monthly, but you can tag @lindalu-MSFT in a comment for faster response!
3
+
4
+
## Get Office VBA support on Microsoft Q&A
5
+
There is a new forum on Microsoft Q&A for your VBA questions. To ask the developer community questions about your VBA code, go to the [Microsoft Q&A office-vba-dev forum](https://docs.microsoft.com/en-us/answers/questions/topics/single/192523.html).
6
+
7
+
## Join the Microsoft 365 Developer Program
8
+
Get a free sandbox, tools, and other resources you need to build solutions for the Microsoft 365 platform.
9
+
-[Free developer sandbox](https://developer.microsoft.com/microsoft-365/dev-program#Subscription) Get a free, renewable 90-day Microsoft 365 E5 developer subscription.
10
+
-[Sample data packs](https://developer.microsoft.com/microsoft-365/dev-program#Sample) Automatically configure your sandbox by installing user data and content to help you build your solutions.
11
+
-[Access to experts](https://developer.microsoft.com/microsoft-365/dev-program#Experts) Access community events to learn from Microsoft 365 experts.
12
+
-[Personalized recommendations](https://developer.microsoft.com/microsoft-365/dev-program#Recommendations) Find developer resources quickly from your personalized dashboard.
13
+
1
14
## Microsoft Open Source Code of Conduct
2
15
3
16
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
@@ -7,4 +20,3 @@ For more information, see the [Code of Conduct FAQ](https://opensource.microsoft
7
20
The live docs for this repo can be accessed at https://docs.microsoft.com/office/vba/api/overview/.
8
21
9
22
For information about how to contribute to this documentation, see [Contributing](contributing.md).
Copy file name to clipboardexpand all lines: api/Access.Application.Nz.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Variant
38
38
39
39
## Remarks
40
40
41
-
If the _Value_ of the variant argument is **Null**, the **Nz** function returns an unassigned **Variant**, the special value **[Empty](../language/glossary/vbe-glossary#empty)**. In VBA, **Empty** evaluates to the number zero or a zero-length string, depending on whether the context indicates that the _Value_ should be a number or a string. For example:
41
+
If the _Value_ of the variant argument is **Null**, the **Nz** function returns an unassigned **Variant**, the special value **[Empty](../language/glossary/vbe-glossary.md#empty)**. In VBA, **Empty** evaluates the number zero or a zero-length string, depending on whether the context indicates that the _Value_ should be a number or a string. For example:
42
42
43
43
```vb
44
44
Nz(Null)+2' returns 2
@@ -47,7 +47,7 @@ Nz(Null) + "2" ' returns "2"
47
47
Nz(Null)&"2"' returns "2"
48
48
```
49
49
50
-
When used in a query expression, however, **Nz**always returns a zero-length string.
50
+
When used in a query expression, **Nz**will return similar result values.
51
51
52
52
If the optional _ValueIfNull_ argument is included, the **Nz** function will return the value specified by that argument if the variant argument is **Null**.
Copy file name to clipboardexpand all lines: api/Access.DoCmd.Hourglass.md
+2
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,8 @@ You often use this method if you've turned echo off by using the **Echo** method
38
38
39
39
Access automatically resets the _HourglassOn_ argument to **False** when the procedure finishes running.
40
40
41
+
To determine the current state of the hourglass, you can check the value of [Screen.MousePointer](https://docs.microsoft.com/office/vba/api/access.screen.mousepointer). If `Screen.MousePointer = 11`, the hourglass is currently being displayed.
42
+
41
43
42
44
43
45
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
Copy file name to clipboardexpand all lines: api/Access.Module.ProcStartLine.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -40,17 +40,17 @@ The _ProcKind_ argument can be one of the following **vbext_ProcKind** constants
40
40
|**vbext_pk_Get**|A **Property Get** procedure.|
41
41
|**vbext_pk_Let**|A **Property Let** procedure.|
42
42
|**vbext_pk_Proc**|A **Sub** or **Function** procedure.|
43
-
|**vbext_pk_Set**|A **Property Se** t procedure.|
43
+
|**vbext_pk_Set**|A **Property Set** procedure.|
44
44
45
-
A procedure begins with any comments and compilation constants that immediately precede the procedure definition, denoted by one of the following:
45
+
A procedure begins with any blank lines, comments and compilation constants that immediately precede the procedure definition, denoted by one of the following:
46
46
47
47
- A **Sub** statement
48
48
- A **Function** statement
49
49
- A **Property Get** statement
50
50
- A **Property Let** statement
51
51
- A **Property Set** statement
52
52
53
-
The **ProcStartLine** property returns the number of the line on which the specified procedure begins. The beginning of the procedure may include comments or compilation constants that precede the procedure definition.
53
+
The **ProcStartLine** property returns the number of the line on which the specified procedure begins. The beginning of the procedure may include blank lines, comments or compilation constants that precede the procedure definition.
54
54
55
55
To determine the line on which the procedure definition begins, use the **[ProcBodyLine](Access.Module.ProcBodyLine.md)** property. This property returns the number of the line that begins with a **Sub**, **Function**, **Property Get**, **Property Let**, or **Property Set** statement.
56
56
@@ -59,7 +59,7 @@ The **ProcStartLine** and **ProcBodyLine** properties can have the same value if
59
59
It may be easier to determine where a procedure begins if you have the **Procedure Separator** option selected. With this option selected, there is a line between the end of a procedure and the beginning of the next procedure. The first line of code (or blank line) below the procedure separator is the first line of the following procedure, which is the line returned by the **ProcStartLine** property. The **Procedure Separator** option is located on the **Editor** tab of the **Options** dialog box, available by choosing **Options** on the **Tools** menu.
60
60
61
61
> [!NOTE]
62
-
> The **ProcStartLine** property treats **Sub** and **Function** procedures similarly, but distinguishes between each type of Property procedure.
62
+
> The **ProcStartLine** property treats **Sub** and **Function** procedures similarly, but distinguishes between each type of **Property** procedure.
63
63
64
64
65
65
## Example
@@ -79,4 +79,4 @@ MsgBox "The procedure " & strProc & " starts on line " & _
79
79
80
80
81
81
82
-
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
82
+
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
The next example uses a static array to store the names of the databases in the current directory. To call this function, enter **ListMDBs** as the **RowSourceType** property setting and leave the **RowSource** property setting blank.
92
98
93
99
```vb
94
-
FunctionListMDBs(fldAsControl,idAsVariant,_
95
-
rowAsVariant,colAsVariant,_
96
-
codeAsVariant)AsVariant
97
-
Staticdbs(127)AsString,EntriesAsInteger
98
-
DimReturnValAsVariant
99
-
ReturnVal=Null
100
-
SelectCasecode
101
-
CaseacLBInitialize' Initialize.
102
-
Entries=0
103
-
dbs(Entries)=Dir("*.MDB")
104
-
DoUntildbs(Entries)=""OrEntries>=127
105
-
Entries=Entries+1
106
-
dbs(Entries)=Dir
107
-
Loop
108
-
ReturnVal=Entries
109
-
CaseacLBOpen' Open.
110
-
' Generate unique ID for control.
111
-
ReturnVal=Timer
112
-
CaseacLBGetRowCount' Get number of rows.
113
-
ReturnVal=Entries
114
-
CaseacLBGetColumnCount' Get number of columns.
115
-
ReturnVal=1
116
-
CaseacLBGetColumnWidth' Column width.
117
-
' -1 forces use of default width.
118
-
ReturnVal=-1
119
-
CaseacLBGetValue' Get data.
120
-
ReturnVal=dbs(row)
121
-
CaseacLBEnd' End.
122
-
Erasedbs
123
-
EndSelect
124
-
ListMDBs=ReturnVal
100
+
PublicFunctionListMDBs(fldAsControl,idAsVariant,_
101
+
rowAsVariant,colAsVariant,codeAsVariant)_
102
+
AsVariant
103
+
104
+
Staticdbs(127)AsString
105
+
StaticEntriesAsInteger
106
+
DimReturnValAsVariant
107
+
108
+
ReturnVal=Null
109
+
SelectCasecode
110
+
CaseacLBInitialize' Initialize.
111
+
Entries=0
112
+
dbs(Entries)=Dir("*.MDB")
113
+
DoUntildbs(Entries)=""OrEntries>=127
114
+
Entries=Entries+1
115
+
dbs(Entries)=Dir
116
+
Loop
117
+
ReturnVal=Entries
118
+
CaseacLBOpen' Open.
119
+
' Generate unique ID for control.
120
+
ReturnVal=Timer
121
+
CaseacLBGetRowCount' Get number of rows.
122
+
ReturnVal=Entries
123
+
CaseacLBGetColumnCount' Get number of columns.
124
+
ReturnVal=1
125
+
CaseacLBGetColumnWidth' Column width.
126
+
' -1 forces use of default width.
127
+
ReturnVal=-1
128
+
CaseacLBGetValue' Get data.
129
+
ReturnVal=dbs(row)
130
+
CaseacLBEnd' End.
131
+
Erasedbs
132
+
EndSelect
133
+
ListMDBs=ReturnVal
134
+
125
135
EndFunction
126
136
```
127
137
128
138
129
-
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
139
+
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
0 commit comments