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.

Varios On Error Goto [Label]

publicado

Buenas, estoy intentando controlar varios errores en un código con la instrucción "On Error Goto [LABEL"]. El primer error que detecta sí que funciona bien pero en el siguiente ya da error.

 

La idea del código es que mire si hay determinada imagen en la hoja y en caso de que no la localice pase a la siguiente línea para ver si hay otra imagen que me interesa localizar

 

Adjunto archivo.

 

Saludos y gracias

PruebaError.xlsm

Featured Replies

publicado

Por alguna razón, ciertos errores se escapan a On Error, así te funcionará.

Sub pruebaImg(): On Error Resume Next

Sheets("Full2").Select

Sheets("Full1").Shapes("Imagen1").Copy
If Err.Number = 0 Then
  Range("c1").Select
  ActiveSheet.Paste
End If
Err.Number = 0

Sheets("Full1").Shapes("Imagen2").Copy
If Err.Number = 0 Then
  Range("e1").Select
  ActiveSheet.Paste
End If
Err.Number = 0

Sheets("Full1").Shapes("Imagen3").Copy
If Err.Number = 0 Then
  Range("i1").Select
  ActiveSheet.Paste
End If
Err.Number = 0

Sheets("Full1").Shapes("Imagen4").Copy
If Err.Number = 0 Then
  Range("m1").Select
  ActiveSheet.Paste
End If
Err.Number = 0

Sheets("Full1").Shapes("Imagen5").Copy
If Err.Number = 0 Then
  Range("r1").Select
  ActiveSheet.Paste
End If
End Sub

 

publicado
  • Autor

Muchas gracias por la respuesta Antoni. Funciona perfectamente.

Saludos!

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.