-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobal_var
More file actions
62 lines (55 loc) · 2.27 KB
/
Copy pathGlobal_var
File metadata and controls
62 lines (55 loc) · 2.27 KB
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
Attribute VB_Name = "Global_var"
Global shouldCancel As Boolean
Global Const DATE_RANGE As String = "AG4:AG2500"
Global Const ISBN_RANGE As String = "T4:T2500"
Global Const PUBLISHER_RANGE As String = "U4:U2500"
Global Const GRAPH_RANGE As String = "AK16:AR36"
Global Const GRAPH_RANGE_PLUS_ONE As String = "AJ15:AR37"
Global Const FUCKING_COLUMN As String = "AH:AH"
Global Const FUCKING_COLUMN_PLUS_ONE As String = "AH:AU"
Global Const AUTHORS_COLUMN As String = "B3:J3500"
Global Const HEIGTH_COLUMN As String = "AA4:AA2500"
Global Const WIDTH_COLUMN As String = "AB4:AB2500"
Global Const TITLE_COLUMN As String = "N4:N2500"
Global Const ILUSTRATOR_COLUMN As String = "L3:L3500"
Global Const STYLE_BOLD As String = "A4:A2500,N4:N2500"
Global Const STYLE_WEBDINGS As String = "X4:Y2500,AE4:AE2500"
Global Const STYLE_NUMBER As String = "AA4:AC2500"
Global Const STYLE_TABLE As String = "A4:AG2500"
Public Function autoFill(cell As Range)
Dim ISBN As String
Dim DBKsuccess As Boolean
Dim GRsuccess As Boolean
ISBN = VBA.Replace(cell.Value, "-", "")
If IsEmpty(cell.offset(0, -6)) And Len(cell.Value) > 5 Then 'if Title is empty and ISBN at least 5 chars
DBKsuccess = scrapWeb(ISBN, cell.row)
If DBKsuccess = False Then
If Len(ISBN) > 7 Then
GRsuccess = fillBookByISBN(ISBN, cell.row)
End If
End If
If DBKsuccess = False And GRsuccess = False Then
MsgBox "Chyba API: Kniha nebola nájdená"
End If
End If
Application.StatusBar = False
End Function
Public Function switchNames(meno As String)
Dim arrayOfWords
Dim length As Integer
Dim menoTemp As String
If meno = "kolektiv autorù" Or meno = "* antologie" Then
switchNames = "kolektiv"
Exit Function
End If
If InStr(meno, "(p)") Then
meno = Replace(meno, " (p)", "")
End If
arrayOfWords = Split(meno, " ")
length = UBound(arrayOfWords) - LBound(arrayOfWords)
For i = 0 To length - 1
menoTemp = menoTemp & " " & arrayOfWords(i)
Next i
'for Return, you have to assing value to the name of a function
switchNames = arrayOfWords(UBound(arrayOfWords)) & ", " & Trim(menoTemp)
End Function