2004-VBA Data Type
No | Item | Content | ConvertFunc |
---|---|---|---|
1 | Primitive | ||
2 | Boolean | Dim bln As Boolean | CBool(value) |
3 | Long | Dim i As Long | CLng(value) |
4 | Double | Dim n As Double | CDbl(value) |
5 | Currency | Dim yen As Currency | CCur(value) |
6 | Date | Dim dtm As Date | CDate(value) |
7 | String | Dim str As String | CStr(value) |
8 | Variant | Dim vnt As Variant | CVar(value) |
9 | Byte | CByte(value) | |
10 | Interger | CInt(value) | |
11 | Single | CSng(value) | |
12 | VBA variable | ||
13 | Array | Primitive型を配列で定義 | |
14 | Collection | "Dim clt As Collection (key Arrayが取れない) Set clt = New Collection" |
|
15 | Excel Object | ||
16 | Range | "Dim rng As Range Let rng = ThisWorkbook.WorkSheets(Activeworksheet.Name).Range(""A1"")" |
|
17 | Worksheet | "Dim sht As Worksheet Set sht = ThisWorkbook.WorkSheets(Activeworksheet.Name)" |
|
18 | Workbook | "Dim wb As Workbook Set wb = ThisWorkbook" |
|
19 | Name | "Dim nm As Name Set nm = ThisWorkbook.Names(""target_name"")" |
|
20 | ListObject | Dim lstObj As ListObject | |
21 | Chart | Dim cht As Chart | - |
22 | Shape | Dim shp As Shape | - |
23 | VBScript COM Object | ||
24 | Microsoft Scripting Runtime | ||
25 | Dictionary | Dim dict As Dictionary | |
26 | FileSystemObject | Dim objFSO As FileSystemObject | |
27 | Folder | Dim folder As Folder | |
28 | File | Dim file As File | |
29 | .Net Framework | ||
30 | ArrayList | "Set a reference on VBA Toolbar of tool -> referenceC:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb Microsoft Common Language Runtime Class Library Dim aryList As Object '// ArrayList Set aryList = CreateObject(""System.Collections.ArrayList"")" |
|
31 | StringBuilder | Set objSB = CreateObject("System.Text.StringBuilder") | |
32 | Third Party Utility Libraries | ||
33 | JSON | Dim JSON As JSONLib | |
34 | Template | Dim Template As MiniTemplator | |
35 | Custom Type or Object | ||
36 | Enum | ||
37 | Type | ||
38 | Class | ||