Bienvenido a la mayor comunidad de usuarios EXCEL

Regístrate gratis ahora para ver contenidos y descargas sin restricciones!

Regístrate gratis

bordear coincidencias en un rango de datos

magoblue

Active member
Registrado
25 Ago 2021
Mensajes
382
hola expertos buenos dias como puedo realizar la siguiente tarea:
tengo un numero en la celda Y10 y me gustaria que se bordaran aquellas celdas que cumplen con coincidencia
.las dos primera
.las...
Para poder visualizar el resto de este tema y sus adjuntos:
. Si nunca te has registrado puedes registrarte gratis aquí
. Si ya te has registrado debes
iniciar sesión aquí
 

Adjuntos

Solución
Código:
Sub PonerBordes()
Application.ScreenUpdating = False
For x = 1 To ActiveSheet.UsedRange.Rows.Count
   For y = [Z1].Column To [BG1].Column
      Cells(x, y).BorderAround LineStyle:=xlLineStyleNone
      If Mid([Y10], 1, 2) = Mid(Cells(x, y), 1, 2) Or _
         Mid([Y10], 2, 2) = Mid(Cells(x, y), 2, 2) Or _
         Mid([Y10], 3, 2) = Mid(Cells(x, y), 3, 2) Or _
        (Mid([Y10], 1, 1) = Mid(Cells(x, y), 1, 1) And Mid([Y10], 3, 1) = Mid(Cells(x, y), 3, 1)) Or _
        (Mid([Y10], 1, 1) = Mid(Cells(x, y), 1, 1) And Mid([Y10], 4, 1) = Mid(Cells(x, y), 4, 1)) Or _
        (Mid([Y10], 2, 1) = Mid(Cells(x, y), 2, 1) And Mid([Y10], 4, 1) = Mid(Cells(x, y), 4, 1)) Then
         Cells(x, y).BorderAround ColorIndex:=5, Weight:=xlThick
      End If
   Next...

Adjuntos

Volver
Arriba