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.

Qué es más eficiente Target.Offset o Range

publicado

Buenas noches amigos, tengo una pregunta, ¿cuál de los dos métodos es más eficiente y porqué?,

este, utilizando Target.Offset:

If Not Intersect(Target, Range("K4")) Is Nothing Then
Target.Offset(3, -2) = ""
Target.Offset(3, -7) = ""
Target.Offset(3, -7).Select
End If
[/CODE]

o este, utilizando Range:

[CODE]If Not Intersect(Target, Range("K4")) Is Nothing Then
Range("I7") = ""
Range("D7") = ""
Range("D7").Select
End If
[/CODE]

Saludos.

Featured Replies

publicado

Buenas,

A mi entender, si conoces con anterioridad los rangos con los que vas a trabajar, el "Range" es más cómodo de utilizar, pero sin embargo, si estás trabajando con una columna o fila como referencia más que con una celda fija, quizás el "Target.offset" te permita más flexibilidad. Si en tu primer ejemplo, en vez de "If Not Intersect(Target, Range("K4"))" tuvieras "If Not Intersect(Target, Columns("K:K"))" el Offset te ofrece la oportunidad de una referencia relativa válida para toda la columna.

Un saludo,

Tese

publicado

En el rango de tu ejemplo paracticamente no hay diferencia en eficiencia, si el rango fuera extenso, quiza miles de celdas, lo mas eficiente es usar arrays.

publicado
  • Autor

Gracias, y con respecto al Cells(,) más de lo mismo verdad?,

si es así me decanto por Range ya que trabajo con celdas fijas y es más sencillo.

Otra duda que se me plantea, es mejor utilizar esto:

R[/FONT]

[LEFT][COLOR=#333333][FONT=Verdana]ange("D7") = "" o Range("D7").ClearContents[/FONT][/COLOR][/LEFT]

[/CODE]

[font=Verdana]

[/font]

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.