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 en macro ajusta rango

publicado

Hola buenas tardes:

Tengo la siguiente estructura de macro:

Sub AjustarRangoD()
Dim rngC As Range
For Each rngC In [Anexos!d14:d20]
AjustarTextoEnCeldasCombinadas rngC.MergeArea (macro para ajustar tamaño a los rangos indicados)
Next rngC
End Sub

funciona bien, pero cada que abro mi libro, este me marca un error 424 se requiere un objeto. y marca en amarillo la 2da linea de mi macro. y detiene la ejecución de la macro.

Esta macro la llamo dentro de una estructura Worksheet_Calculate()

Public Sub Worksheet_Calculate()
  Static ValorPrevio
  Application.EnableEvents = False ' Prevenimos un posible bucle debido a cambios en la hoja '
  If Hoja2.Range("f13") <> ValorPrevio Then ' Verificamos si el valor  ha cambiado respecto al valor anterior '
   ' Application.Run ("AjustarRangoD")   ''Lanzamos macro '
       ValorPrevio = Hoja2.Range("f13") ' Cargamos de nuevo la variable de control de cambio '
  End If ' Empieza el otro macro '
 
  Rows("15").Hidden = Range("d15") = 0
  Rows("23").Hidden = Range("d15") <> 0
Rows("24").Hidden = Range("v21") = "Aj"

  Application.EnableEvents = True ' Restablecemos los eventos '
     
End Sub

Muchas gracias

Mariano

 

 

Featured Replies

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.