Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

error 28

publicado

Hola, tengo este pequeño código, pero... al ejecutarlo se me queda el puntero del ratón (en círculo)girando

y tengo que salir con CERRAR SESIÓN.

Podéis ayudarme de forma muy sencilla ? mi código es este:

Private Sub WorkSheet_Change(ByVal Target As Excel.Range)
If Range("$L$7").Value = "1" Then
Call Macro18
End If
End Sub
Sub Macro18()
Application.ScreenUpdating = False
Dim Str1 As String
Dim Str2 As String
Dim resultado1 As Long
Str1 = Range("C8")
Str2 = Range("L9")
resultado1 = StrComp(Str1, Str2, vbTextCompare)
Range("N9") = resultado1 + 1
Sheets("Hoja1").Select
Application.ScreenUpdating = True
Range("A1").Select
End Sub
 

Featured Replies

publicado

Hola

En general no es conveniente usar "Select" pero yendo a tu dilema, probablemente al insertar un valor en N9 se vuelve a activar el evento "Change" entrando en un bucle "infinito". Cambia así tu macro:

Sub Macro18()
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim Str1 As String
Dim Str2 As String
Dim resultado1 As Long
Str1 = Range("C8")
Str2 = Range("L9")
resultado1 = StrComp(Str1, Str2, vbTextCompare)
Range("N9") = resultado1 + 1
Sheets("Hoja1").Select
Application.ScreenUpdating = True
Range("A1").Select
Application.EnableEvents = True
End Sub

Comentas

Abraham Valencia

publicado

Muchas Gracias.

publicado

Gracias, ahora tengo esto, Y ME FUNCIONA, pero...me sale Error 28 Espacio de pila insuficiente. Pero la macro funciona, solo que me sale el letrero (msgbox) y hasta que no lo pulso no se va, pero la macro funciona. Te envío el código:

Private Sub WorkSheet_Change(ByVal Target As Excel.Range)
If Range("$L$7").Value = "1" Then
Macro18
End If
End Sub
Sub Macro18()
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim Str1 As String
Dim Str2 As String
Dim resultado1 As Long
Str1 = Range("C8")
Str2 = Range("L9")
resultado1 = StrComp(Str1, Str2, vbTextCompare)
Range("N9") = resultado1 + 1
Sheets("Hoja1").Select
Application.ScreenUpdating = True
Range("a1").Select
Application.EnableEvents = True
If Range("N9").Value = "1" Then
macro1
End If
End Sub

Sub macro1()
Range("J20").Value = "Debo poner esto funciona"
End Sub

publicado

En lugar de esto:

...
...
Application.EnableEvents = True
If Range("N9").Value = "1" Then
macro1
End If
End Sub

debe poner esto:

...
...
If Range("N9").Value = "1" Then
macro1
End If
Application.EnableEvents = True
End Sub

 

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.