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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
| Private Sub UserForm_Initialize()
'For i = 0 To 28
'Controls(i).Enabled = True
' Next i
TextBox1.Value = 4
TextBox2.Value = 4
TextBox3.Value = 4
TextBox4.Value = 4
TextBox5.Value = 4
TextBox6.Value = 4
TextBox7.Value = 4
TextBox8.Value = 4
TextBox9.Value = 4
TextBox10.Value = 4
TextBox11.Value = 4
TextBox12.Value = 4
'For i = 17 To 22
'Controls(i).Enabled = False
' Next i
End Sub
Private Sub TextBox1_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox1.Value & ".jpg "
CommandButton1.Picture = LoadPicture(a)
End Sub
Private Sub TextBox10_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox10.Value & ".jpg "
CommandButton10.Picture = LoadPicture(a)
End Sub
Private Sub TextBox11_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox11.Value & ".jpg "
CommandButton11.Picture = LoadPicture(a)
End Sub
Private Sub TextBox12_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox12.Value & ".jpg "
CommandButton12.Picture = LoadPicture(a)
End Sub
Private Sub TextBox2_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox2.Value & ".jpg "
CommandButton2.Picture = LoadPicture(a)
End Sub
Private Sub TextBox3_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox3.Value & ".jpg "
CommandButton3.Picture = LoadPicture(a)
End Sub
Private Sub TextBox4_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox4.Value & ".jpg "
CommandButton4.Picture = LoadPicture(a)
End Sub
Private Sub TextBox5_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox5.Value & ".jpg "
CommandButton5.Picture = LoadPicture(a)
End Sub
Private Sub TextBox6_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox6.Value & ".jpg "
CommandButton6.Picture = LoadPicture(a)
End Sub
Private Sub TextBox7_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox7.Value & ".jpg "
CommandButton7.Picture = LoadPicture(a)
End Sub
Private Sub TextBox8_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox8.Value & ".jpg "
CommandButton8.Picture = LoadPicture(a)
End Sub
Private Sub TextBox9_Change()
b = ActiveWorkbook.Path
a = b & "\" & TextBox9.Value & ".jpg "
CommandButton9.Picture = LoadPicture(a)
End Sub
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 1 To 30
traitons i
Next
End Sub
Private Sub traitons(num As Integer)
If TextBox1.Value = num Then
TextBox1.Value = 0
For i = 2 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton2_Click()
Dim i As Integer
For i = 1 To 30
traitons2 i
Next
End Sub
Private Sub traitons2(num As Integer)
If TextBox2.Value = num Then
TextBox2.Value = 0
For i = 3 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton3_Click()
Dim i As Integer
For i = 1 To 30
traitons3 i
Next
End Sub
Private Sub traitons3(num As Integer)
If TextBox3.Value = num Then
TextBox3.Value = 0
For i = 4 To num + 3
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton4_Click()
Dim i As Integer
For i = 1 To 30
traitons4 i
Next
End Sub
Private Sub traitons4(num As Integer)
If TextBox4.Value = num Then
TextBox4.Value = 0
For i = 5 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton5_Click()
Dim i As Integer
For i = 1 To 30
traitons5 i
Next
End Sub
Private Sub traitons5(num As Integer)
If TextBox5.Value = num Then
TextBox5.Value = 0
For i = 6 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton6_Click()
Dim i As Integer
For i = 1 To 30
traitons6 i
Next
End Sub
Private Sub traitons6(num As Integer)
If TextBox6.Value = num Then
TextBox6.Value = 0
For i = 7 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton7_Click()
Dim i As Integer
For i = 1 To 30
traitons7 i
Next
End Sub
Private Sub traitons7(num As Integer)
If TextBox7.Value = num Then
TextBox7.Value = 0
For i = 8 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton8_Click()
Dim i As Integer
For i = 1 To 30
traitons8 i
Next
End Sub
Private Sub traitons8(num As Integer)
If TextBox8.Value = num Then
TextBox8.Value = 0
For i = 9 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton9_Click()
Dim i As Integer
For i = 1 To 30
traitons9 i
Next
End Sub
Private Sub traitons9(num As Integer)
If TextBox9.Value = num Then
TextBox9.Value = 0
For i = 10 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton10_Click()
Dim i As Integer
For i = 1 To 30
traitons10 i
Next
End Sub
Private Sub traitons10(num As Integer)
If TextBox10.Value = num Then
TextBox10.Value = 0
For i = 11 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton11_Click()
Dim i As Integer
For i = 1 To 30
traitons11 i
Next
End Sub
Private Sub traitons11(num As Integer)
If TextBox11.Value = num Then
TextBox11.Value = 0
For i = 12 To num + 1
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub
Private Sub CommandButton12_Click()
Dim i As Integer
For i = 1 To 30
traitons12 i
Next
End Sub
Private Sub traitons12(num As Integer)
If TextBox12.Value = num Then
TextBox12.Value = 0
For i = 13 To num + 12
Me.Controls("TextBox" & i).Value = Me.Controls("TextBox" & i).Value + 1
Next
End If
End Sub |