
error 9 en tiempos de ejecución
Publicado por mariana (1 intervención) el 21/11/2015 23:18:46
estoy haciendo un proyecto para que se me registren las ventas de un restaurante. Al correr mi macro, me hace la pregunta y después me saca: "se ha producido el error 9 en tiempo de ejecución: el subíndice esta fuera del intervalo". No se como corregirlo. Me podrían ayudar por favor.
Esta es la macro:
Esta es la macro:
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
Sub orden()
Dim refresco As Integer
Dim agua As Integer
Dim bebida_tropical As Integer
Dim tostada As Integer
Dim camarones As Integer
Dim ceviche As Integer
Dim hamburguesa As Integer
Dim pulpo As Integer
Dim salmon As Integer
Dim helado As Integer
Dim strudel As Integer
Dim pastel As Integer
bebida = vbYes
'entrada = vbYes
'platof = vbYes
'postre = vbYes
acumref = 0
acumag = 0
acumbeb = 0
'acump = 0
Do While bebida = vbYes
bebida = InputBox("deseas alguna bebida")
If bebida = "refresco" Then
Workbooks("mybooks.xls").Sheets("venta").Range(C3).Select
acumref = acumref + 1
ActiveCell.Value = acumref
ElseIf bebida = "agua" Then
Workbooks("mybooks.xls").Sheets("venta").Range(C4).Select
acumag = acumag + 1
ActiveCell.Value = acumag
Else: bebida = "bebidatr"
Workbooks("mybooks.xls").Sheets("venta").Range(C5).Select
acumbeb = acumbeb + 1
ActiveCell.Value = acumbeb
End If
Loop
'Do While entrada = vbYes
End Sub
Valora esta pregunta


0