-
Notifications
You must be signed in to change notification settings - Fork 0
/
SI-Berechnung.vb
151 lines (142 loc) · 5.02 KB
/
SI-Berechnung.vb
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Sub Makro1()
'
' Makro1 Makro
'
'
Application.CutCopyMode = False
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\Evgeniy.MEDIAWORXDE\Downloads\Versicherungen-Research\Project_ Versicherungen SI (1)\domains\advigon.com.csv" _
, Destination:=Range("$A$1"))
.Name = "advigon.com"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 65001
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("A5").Select
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
ChDir "C:\Users\Evgeniy.MEDIAWORXDE\Downloads"
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\Evgeniy.MEDIAWORXDE\Downloads\advigon.com.xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Rows("4:5").Select
Selection.Delete Shift:=xlUp
Rows("1:2").Select
Selection.Delete Shift:=xlUp
End Sub
Sub Makro2()
'
' Makro2 Makro
'
'
Range("G1").Select
ActiveCell.FormulaR1C1 = "Brand"
Range("G2").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(C[-6],'[Versicherungen-Brand-Non-Brand-KWs-SV.xlsx]Brand+Non-Brand Keywords mit SV'!C1:C3,3,0)"
End Sub
Sub Makro3()
'
' Makro3 Makro
'
'
Range("H1").Select
ActiveCell.FormulaR1C1 = "SI"
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(((VLOOKUP(RC[-7],'[Versicherungen-Brand-Non-Brand-KWs-SV.xlsx]Brand+Non-Brand Keywords mit SV'!C1:C2,2,0))/RC[-2])+(IF(RC[-2]=1,""33,9"",IF(RC[-2]=2,""16,28"",IF(RC[-2]=3,""10,36"",IF(RC[-2]=4,""7"",IF(RC[-2]=5,""5,64"")))))+IF(RC[-2]=6,""4,13"",IF(RC[-2]=7,""3,27"",IF(RC[-2]=8,""2,61"",IF(RC[-2]=9,""2,18"",IF(RC[-2]=10,""1,82"")))))+IF(RC[-2]=11,""1,77"",I" & _
"F(RC[-2]=12,""1,81"",IF(RC[-2]=13,""1,85"",IF(RC[-2]=14,""1,9"",IF(RC[-2]=15,""2,04"")))))+IF(RC[-2]=16,""1,68"",IF(RC[-2]=17,""1,61"",IF(RC[-2]=18,""1,65"",IF(RC[-2]=19,""1,62"",IF(RC[-2]=20,""1,59"",""0"")))))),0)" & _
""
Range("H3").Select
End Sub
Sub Makro4()
'
' Makro4 Makro
'
'
Range("J1").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Tabelle1!R1C7:R1048576C8", Version:=6).CreatePivotTable TableDestination:= _
"Tabelle1!R1C10", TableName:="PivotTable5", DefaultVersion:=6
Sheets("Tabelle1").Select
Cells(1, 10).Select
With ActiveSheet.PivotTables("PivotTable5")
.ColumnGrand = True
.HasAutoFormat = True
.DisplayErrorString = False
.DisplayNullString = True
.EnableDrilldown = True
.ErrorString = ""
.MergeLabels = False
.NullString = ""
.PageFieldOrder = 2
.PageFieldWrapCount = 0
.PreserveFormatting = True
.RowGrand = True
.SaveData = True
.PrintTitles = False
.RepeatItemsOnEachPrintedPage = True
.TotalsAnnotation = False
.CompactRowIndent = 1
.InGridDropZones = False
.DisplayFieldCaptions = True
.DisplayMemberPropertyTooltips = False
.DisplayContextTooltips = True
.ShowDrillIndicators = True
.PrintDrillIndicators = False
.AllowMultipleFilters = False
.SortUsingCustomLists = True
.FieldListSortAscending = False
.ShowValuesRow = False
.CalculatedMembersInFilters = False
.RowAxisLayout xlCompactRow
End With
With ActiveSheet.PivotTables("PivotTable5").PivotCache
.RefreshOnFileOpen = False
.MissingItemsLimit = xlMissingItemsDefault
End With
ActiveSheet.PivotTables("PivotTable5").RepeatAllLabels xlRepeatLabels
With ActiveSheet.PivotTables("PivotTable5").PivotFields("Brand")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable5").AddDataField ActiveSheet.PivotTables( _
"PivotTable5").PivotFields("SI"), "Summe von SI", xlSum
End Sub
Sub Makro5()
'
' Makro5 Makro
'
'
Range("J2:K6").Select
Selection.Copy
Windows("si.xlsx").Activate
Range("B2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub