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.

VLOOKUP y HLOOKUP combinados

publicado

Holas a tod@as,

Necesito saber si hay algún comando que combine VLOOKUP y HLOOKUP. Mi problema es el siguiente:

Estoy utilizando el comando VLOOKUP pero necesito guardar tambien los valores de las 2 celdas que esten debajo de la celda encontrada con VLOOKUP

'INSTALACIONES GENERALES 

sub PASAR_DATOS
r = 0
For vueltas = 0 To 2
VALOR = Application.VLookup("INSTALACIONES GENERALES", Sheets("PAROS").Range("A2:M500"), 11, False) ''''''''' el primer valor me lo guarda bien en la variable VALOR, pero quisiera que cuando r = 1 me guardase en la variable VALOR el valor de la celda que este debajo de la encontrada con VLOOKUP. Cuando r = 2 guardar el valor de la celda que este 2 por debajo de la encontrada con VLOOKUP''''''''''''''''
If IsError(VALOR) Then
Else
    Sheets("SEMANAL PV1-PV3-PV5-M16").Cells(27, 9 - r) = VALOR ''''''Aqui copiaria el valor de la celda encontrada
End If

r = r + 1
Next vueltas

End sub

Featured Replies

publicado

Yo te propondría que usases la función Find, declarando  VALOR como range, con lo cual siempre puedes hayar su offset,

Sub pasar_valor()
Dim valor As Range
Dim encontrar As String
Dim r%

encontrar = "INSTALACIONES GENERALES"

    Set valor = Range("A2:M500").Find(encontrar, lookat:=xlWhole)
    If Not valor Is Nothing Then
        For r = 0 To 2
            Cells(valor.Row + r, valor.Column).Copy Sheets("SEMANAL PV1-PV3-PV5-M16").Cells(27, 9 - r)
        Next r
    Else
        MsgBox "No se encuentra INSTALACIONES GENERALES"
        Exit Sub
    End If

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.