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.

Macro para identificar si el valor a ingresar ya esta.

publicado

Saludos, tengo este macro

Sub nuevos()

Dim ultimafila As Long

Dim Origen As Worksheet, Destino As Worksheet

Set Origen = Sheets("FORMATO")

Set Destino = Sheets("Hoja2")

ultimafila = Sheets("Hoja2").Range("B20000").End(xlUp).Row

ultimafila = ultimafila + 1

PERO POR ESTE LADO QUISIERA VERIFICAR SI LO QUE SE VA A INSERTAR EN LA CELDA K12 DE Origen YA EXISTE EN LA COLUMNA D DE Destino, PARA NO REPETIR LOS VALORES, si no esta repetido ps que inserte los siguientes datos, si no q muestre un mensaje de error y no ingrese los datos.

Destino.Range("B" & ultimafila) = Origen.Range("K10")

Destino.Range("D" & ultimafila) = Origen.Range("K12")

Destino.Range("E" & ultimafila) = Origen.Range("F8")

Destino.Range("F" & ultimafila) = Origen.Range("H8")

Destino.Range("G" & ultimafila) = Origen.Range("J8")

Destino.Range("H" & ultimafila) = Origen.Range("K16")

Destino.Range("I" & ultimafila) = Origen.Range("K14")

Destino.Range("J" & ultimafila) = Origen.Range("K18")

End Sub

pueden ayudarme por favor? Gracias.

Featured Replies

publicado

Puedes hacerlo con contar.si, countif.

Esto puede quedar en una sola linea:

ultimafila = Sheets("Hoja2").Range("B20000").End(xlUp).Row

ultimafila = ultimafila + 1

= ultimafila = Sheets("Hoja2").Range("B20000").End(xlUp).Row + 1

publicado
  • Autor

Hola Armando, soy muy nuevo :apthy:.. y la verdad es que no supe como hacerlo con countif, se necesita un if adicional? me puedes ayudar con ese pedacito.

El valor de origen k17 saber si esta en la columna D de destino si si mensaje de error si no continuar con la rutina

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.