-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExcelToJSONForm.frm
71 lines (66 loc) · 2.15 KB
/
ExcelToJSONForm.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} ExcelToJSONForm
Caption = "Select table(s)"
ClientHeight = 2890
ClientLeft = -950
ClientTop = -4950
ClientWidth = 2480
OleObjectBlob = "ExcelToJSONForm.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "ExcelToJSONForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Declare variable for looping through User Form Controls
Public userFormControl As Object
Private Sub CancelBtn_Click()
End
End Sub
Private Sub SelectAll_Click()
For Each userFormControl In ExcelToJSONForm.Controls
If TypeName(userFormControl) = "CheckBox" Then
userFormControl.Value = True
End If
Next userFormControl
End Sub
Private Sub SelectNone_Click()
For Each userFormControl In ExcelToJSONForm.Controls
If TypeName(userFormControl) = "CheckBox" Then
userFormControl.Value = False
End If
Next userFormControl
End Sub
Private Sub SubmitBtn_Click()
Dim numCheckedBoxes As Integer
For Each userFormControl In ExcelToJSONForm.Controls
If TypeName(userFormControl) = "CheckBox" Then
If userFormControl = True Then
numCheckedBoxes = numCheckedBoxes + 1
End If
End If
Next userFormControl
If numCheckedBoxes = 0 Then
MsgBox "Please select one or more tables before proceeding"
Else
j = 0
ReDim Preserve usrSlctdTblsNameArray(0 To numCheckedBoxes)
For Each userFormControl In ExcelToJSONForm.Controls
If TypeName(userFormControl) = "CheckBox" Then
If userFormControl = True Then
j = j + 1
usrSlctdTblsNameArray(j) = userFormControl.Caption
End If
End If
Next userFormControl
Me.Hide
End If
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
End
End If
End Sub