Automatizar macro

26/04/2005 - 17:58 por Aeor | Informe spam
Quisiera que en el momento de abrir el libro se ejecutara la macro,
actualmente lo hace manualmente (herramienta > macro > ejecutar) me podeis
ayudar, gracias:

Sub quitafiltro()
Dim i As Integer
Dim nrofiltro
nrofiltro = Array(1, 3, 4)
For i = 0 To 2
Worksheets("Hoja1").Range("A1").AutoFilter _
Field:=nrofiltro(i), VisibleDropDown:=False
Next i
End Sub

Preguntas similare

Leer las respuestas

#1 Juan Pablo González
26/04/2005 - 18:06 | Informe spam
Cambia el nombre de la macro a

Sub Auto_Open()

Regards,

Juan Pablo González
Excel MVP

"Aeor" wrote in message
news:d4loen$vl1$
Quisiera que en el momento de abrir el libro se ejecutara la macro,
actualmente lo hace manualmente (herramienta > macro > ejecutar) me podeis
ayudar, gracias:

Sub quitafiltro()
Dim i As Integer
Dim nrofiltro
nrofiltro = Array(1, 3, 4)
For i = 0 To 2
Worksheets("Hoja1").Range("A1").AutoFilter _
Field:=nrofiltro(i), VisibleDropDown:=False
Next i
End Sub



Respuesta Responder a este mensaje
#2 KL
26/04/2005 - 18:19 | Informe spam
...y depositalo en el modulo ThisWorkbook (EsteLibro) - no cualquier modulo.

Saludos,
KL

"Juan Pablo González" wrote in message
news:
Cambia el nombre de la macro a

Sub Auto_Open()

Regards,

Juan Pablo González
Excel MVP

"Aeor" wrote in message
news:d4loen$vl1$
Quisiera que en el momento de abrir el libro se ejecutara la macro,
actualmente lo hace manualmente (herramienta > macro > ejecutar) me
podeis
ayudar, gracias:

Sub quitafiltro()
Dim i As Integer
Dim nrofiltro
nrofiltro = Array(1, 3, 4)
For i = 0 To 2
Worksheets("Hoja1").Range("A1").AutoFilter _
Field:=nrofiltro(i), VisibleDropDown:=False
Next i
End Sub







Respuesta Responder a este mensaje
#3 Juan Pablo González
26/04/2005 - 18:38 | Informe spam
No... ese sería el

Private Sub Workbook_Open()

el Auto_Open() si necesita estar en un módulo estandar.

Regards,

Juan Pablo González
Excel MVP

"KL" wrote in message
news:
...y depositalo en el modulo ThisWorkbook (EsteLibro) - no cualquier
modulo.

Saludos,
KL

"Juan Pablo González" wrote in message
news:
Cambia el nombre de la macro a

Sub Auto_Open()

Regards,

Juan Pablo González
Excel MVP

"Aeor" wrote in message
news:d4loen$vl1$
Quisiera que en el momento de abrir el libro se ejecutara la macro,
actualmente lo hace manualmente (herramienta > macro > ejecutar) me
podeis
ayudar, gracias:

Sub quitafiltro()
Dim i As Integer
Dim nrofiltro
nrofiltro = Array(1, 3, 4)
For i = 0 To 2
Worksheets("Hoja1").Range("A1").AutoFilter _
Field:=nrofiltro(i), VisibleDropDown:=False
Next i
End Sub











Respuesta Responder a este mensaje
#4 KL
26/04/2005 - 18:47 | Informe spam
Perdon, estaba pensando en Private Sub Workbook_Open() cuando escribi esto.
Gracias.

KL


"Juan Pablo González" wrote in message
news:
No... ese sería el

Private Sub Workbook_Open()

el Auto_Open() si necesita estar en un módulo estandar.

Regards,

Juan Pablo González
Excel MVP

"KL" wrote in message
news:
...y depositalo en el modulo ThisWorkbook (EsteLibro) - no cualquier
modulo.

Saludos,
KL

"Juan Pablo González" wrote in message
news:
Cambia el nombre de la macro a

Sub Auto_Open()

Regards,

Juan Pablo González
Excel MVP

"Aeor" wrote in message
news:d4loen$vl1$
Quisiera que en el momento de abrir el libro se ejecutara la macro,
actualmente lo hace manualmente (herramienta > macro > ejecutar) me
podeis
ayudar, gracias:

Sub quitafiltro()
Dim i As Integer
Dim nrofiltro
nrofiltro = Array(1, 3, 4)
For i = 0 To 2
Worksheets("Hoja1").Range("A1").AutoFilter _
Field:=nrofiltro(i), VisibleDropDown:=False
Next i
End Sub















Respuesta Responder a este mensaje
#5 Aeor
26/04/2005 - 19:46 | Informe spam
Perdona pero no estoy muy puesto en macros y no pillo lo de canviar el
nombre, quieres decir sustituir el Sub quitafiltro(), por Sub Auto_Open(),
si es algo hago mal no me funciona.

Cambia el nombre de la macro a

Sub Auto_Open()

Regards,

Juan Pablo González
Excel MVP

"Aeor" wrote in message
news:d4loen$vl1$
Quisiera que en el momento de abrir el libro se ejecutara la macro,
actualmente lo hace manualmente (herramienta > macro > ejecutar) me
podeis
ayudar, gracias:

Sub quitafiltro()
Dim i As Integer
Dim nrofiltro
nrofiltro = Array(1, 3, 4)
For i = 0 To 2
Worksheets("Hoja1").Range("A1").AutoFilter _
Field:=nrofiltro(i), VisibleDropDown:=False
Next i
End Sub







email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida