Ik heb een aantal vragen betreffende VBA in powerpoint. Ik ben bezig met het interactief maken van een aantal marketingmodellen in powerpoint. Dit heeft als doel dat je een presentatie kan houden voor een bedrijf met powerpoint en dat er meteen een soort van analyse uit komt rollen. Ik ben alleen op een aantal problemen gestuit en hoop dat jullie mij hiermee kunnen helpen. Ik had voordat ik aan deze opdracht ben begonnen nog weinig ervaring met VBA, maar ben na het lezen van een aantal boeken een stuk wijzer geworden. Ik mis alleen de slimmigheidjes waardoor ik soms uren achter elkaar zit te programmeren, terwijl het volgens mij een stuk sneller kan. Dat is ook een tweede reden waarom ik jullie om advies vraag.
Ik ben op de volgende problemen gestuit:
1) (Meteen het grootste probleem.) Ik wil in mijn presentatie een grafiek gebruiken. De waarden voor deze grafiek moeten komen uit de waarden die je kan invullen uit een textbox. Ik ben er alleen niet in geslaagd om bijvoorbeeld excel te koppelen aan de waardes die je in een textbox in ppt invuld. Stel je hebt 1 staaf in een grafiek en de hoogte van die staaf moet dus worden bepaald aan de hand van de waarde die je invult in textbox1. Kan iemand mij uitleggen wat de beste tactiek is.
2) Verder word ik helemaal gek van de ellenlange codes die ik soms moet invoeren, mijn vraag aan jullie of dit niet veel makkelijker kan. Ik heb bijvoorbeeld 5 checkboxes op 1 sheet staan, op de andere sheet staan dan 5 textboxes. Als je dan alleen checkbox1 aanvinkt op sheet 1 dan komt er een text te staan in slide2.textbox1. Tot zo ver alles prima. Maar...Nu wil ik dat je als je alleen checkbox1 en 5 aanvinkt dat de text die bij checkbox5 hoort in textbox2 komt te staan.
Nu heb ik dit als code (waarin ik dus alle mogelijke combinaties probeer te ondervangen):
Dit is dus monnikenwerk waar ik soms helemaal van doordraai, terwijl het uiteindelijke resultaat heel simpel is. Nu is mijn vraag natuurlijk of dit makkelijker kan en hoe.
Bij voorbaat dank!!
Ik ben op de volgende problemen gestuit:
1) (Meteen het grootste probleem.) Ik wil in mijn presentatie een grafiek gebruiken. De waarden voor deze grafiek moeten komen uit de waarden die je kan invullen uit een textbox. Ik ben er alleen niet in geslaagd om bijvoorbeeld excel te koppelen aan de waardes die je in een textbox in ppt invuld. Stel je hebt 1 staaf in een grafiek en de hoogte van die staaf moet dus worden bepaald aan de hand van de waarde die je invult in textbox1. Kan iemand mij uitleggen wat de beste tactiek is.
2) Verder word ik helemaal gek van de ellenlange codes die ik soms moet invoeren, mijn vraag aan jullie of dit niet veel makkelijker kan. Ik heb bijvoorbeeld 5 checkboxes op 1 sheet staan, op de andere sheet staan dan 5 textboxes. Als je dan alleen checkbox1 aanvinkt op sheet 1 dan komt er een text te staan in slide2.textbox1. Tot zo ver alles prima. Maar...Nu wil ik dat je als je alleen checkbox1 en 5 aanvinkt dat de text die bij checkbox5 hoort in textbox2 komt te staan.
Nu heb ik dit als code (waarin ik dus alle mogelijke combinaties probeer te ondervangen):
code:
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
| Private Sub CommandButton2_Click() TextBox1.Text = "" If Slide231.CheckBox1.Value Then infotextbox1 = "Vergrijzing" If Slide231.CheckBox2.Value And Not Slide231.CheckBox1.Value Then infotextbox1 = "Huishoudverdunning" If Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox1 = "Multiculturele samenleving" If Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox1 = "Demografische druk" If Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox1 = "Hogere levensverwachting" TextBox1.Text = infotextbox1 TextBox6.Text = infotextbox6 TextBox7.Text = infotextbox7 TextBox2.Text = "" If Slide231.CheckBox3.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox1.Value And Not CheckBox2.Value Then infotextbox2 = "Demografische druk" If Slide231.CheckBox2.Value And Slide231.CheckBox1.Value Then infotextbox2 = "Huishoudverdunning" If Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox2 = "Multiculturele samenleving" If Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox2 = "Multiculturele samenleving" If Slide231.CheckBox4.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value And Not Slide231.CheckBox3.Value Then infotextbox2 = "Demografische druk" If Slide231.CheckBox5.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox4.Value Then infotextbox2 = "Hogere levensverwachting" If Slide231.CheckBox2.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value Then infotextbox2 = "Demografische druk" If Slide231.CheckBox2.Value And Slide231.CheckBox5.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox4.Value Then infotextbox2 = "Hogere levensverwachting" If Slide231.CheckBox3.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value And Not Slide231.CheckBox5.Value Then infotextbox2 = "Demografische druk" If Slide231.CheckBox3.Value And Slide231.CheckBox5.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value And Not Slide231.CheckBox4.Value Then infotextbox2 = "Hogere levensverwachting" If Slide231.CheckBox4.Value And Slide231.CheckBox5.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value And Not Slide231.CheckBox3.Value Then infotextbox2 = "Hogere levensverwachting" TextBox2.Text = infotextbox2 TextBox3.Text = "" If Slide231.CheckBox2.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox3.Value And Slide231.CheckBox4.Value And Slide231.CheckBox5.Value Then infotextbox3 = "Demografische druk" If Slide231.CheckBox1.Value And Slide231.CheckBox3.Value And Slide231.CheckBox5.Value And Not Slide231.CheckBox2.Value And Not Slide231.CheckBox4.Value Then infotextbox3 = "Hogere levensverwachting" If Slide231.CheckBox1.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox5.Value And Not Slide231.CheckBox2.Value And Slide231.CheckBox4.Value Then infotextbox3 = "Hogere levensverwachting" If Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox3 = "Multiculturele samenleving" If Slide231.CheckBox4.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value And Not Slide231.CheckBox3.Value Then infotextbox3 = "Demografische druk" If Slide231.CheckBox4.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value And Slide231.CheckBox3.Value Then infotextbox3 = "Demografische druk" If Slide231.CheckBox5.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox4.Value Then infotextbox3 = "Hogere levensverwachting" If Slide231.CheckBox2.Value And Slide231.CheckBox3.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox5.Value Then infotextbox3 = "Demografische druk" If Slide231.CheckBox2.Value And Slide231.CheckBox3.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox5.Value Then infotextbox3 = "Hogere levensverwachting" If Slide231.CheckBox2.Value And Slide231.CheckBox4.Value And Slide231.CheckBox5.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox3.Value Then infotextbox3 = "Hogere levensverwachting" If Slide231.CheckBox3.Value And Not Slide231.CheckBox2.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox5.Value Then infotextbox3 = "Hogere levensverwachting" TextBox3.Text = infotextbox3 TextBox4.Text = "" If Slide231.CheckBox4.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value And Slide231.CheckBox3.Value Then infotextbox4 = "Demografische druk" If Slide231.CheckBox5.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value And Slide231.CheckBox3.Value And Not Slide231.CheckBox4.Value Then infotextbox4 = "Hogere levensverwachting" If Slide231.CheckBox5.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox4.Value Then infotextbox4 = "Hogere levensverwachting" If Slide231.CheckBox5.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value And Slide231.CheckBox3.Value And Slide231.CheckBox4.Value Then infotextbox4 = "Hogere levensverwachting" If Slide231.CheckBox5.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox2.Value And Slide231.CheckBox3.Value And Slide231.CheckBox4.Value Then infotextbox4 = "Hogere levensverwachting" TextBox4.Text = infotextbox4 TextBox5.Text = "" If Slide231.CheckBox5.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value And Slide231.CheckBox3.Value And Slide231.CheckBox4.Value Then infotextbox5 = "Hogere levensverwachting" TextBox5.Text = infotextbox5 If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox1 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox2 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox3 = Slide258.TextBox3.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox4.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox5.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox2 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox3 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox3.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox4.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox5.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox3 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox3.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox4.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox7 = Slide258.TextBox5.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox3.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox7 = Slide258.TextBox4.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox7 = Slide258.TextBox3.Text If Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox1.Text If Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox7 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox2 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox3 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox3.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox4.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox5.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox2 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox3 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox3.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox4.Text If Not Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox5.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox2 = Slide258.TextBox1.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox3 = Slide258.TextBox2.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox3.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox4.Text If Not Slide231.CheckBox5.Value And Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox5.Text If Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox2 = Slide258.TextBox1.Text If Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox3 = Slide258.TextBox2.Text If Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox4 = Slide258.TextBox3.Text If Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox5 = Slide258.TextBox4.Text If Slide231.CheckBox5.Value And Not Slide231.CheckBox4.Value And Not Slide231.CheckBox3.Value And Not Slide231.CheckBox1.Value And Not Slide231.CheckBox2.Value Then infotextbox6 = Slide258.TextBox5.Text TextBox1.Text = infotextbox1 TextBox2.Text = infotextbox2 TextBox3.Text = infotextbox3 TextBox4.Text = infotextbox4 TextBox5.Text = infotextbox5 TextBox6.Text = infotextbox6 TextBox7.Text = infotextbox7 End Sub |
Dit is dus monnikenwerk waar ik soms helemaal van doordraai, terwijl het uiteindelijke resultaat heel simpel is. Nu is mijn vraag natuurlijk of dit makkelijker kan en hoe.
Bij voorbaat dank!!