Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por Pegorini
Posts Posts
#67402
Bom dia.

Tenho o seguinte problema:

Tenho vários números em uma determinada coluna e eventualmente ocorre de alguns números estarem repetidos.

Então se algum número estiver repetido gostaria que seja identificado esses números.

A ideia é que os números sejam identificados com preenchimento de cor nas células conforme modelo anexo, mas é possível outra forma caso essa não seja possível.

Sendo assim gostaria da ajuda da comunidade neste problema.
Você não está autorizado a ver ou baixar esse anexo.
Por osvaldomp
#67409
Olá, @Pegorini .

É possível uma solução via macro. Retorne se houver interesse.
Pegorini agradeceu por isso
Por osvaldomp
#67420
Olá, @Pegorini .

Veja se o código abaixo lhe atende.

Instale uma cópia em um módulo comum (Alt+F11 | Inserir Módulo).
Código: Selecionar todos
Sub PintaDuplicados()
 Dim x As Long, s As Range, frst As String, c As Long
  [B:B].Interior.ColorIndex = xlNone
  For x = 3 To Cells(Rows.Count, 2).End(3).Row
   If Application.CountIf([B:B], Cells(x, 2)) > 1 Then
    If Cells(x, 2).Interior.ColorIndex = xlNone Then
     Set s = [B:B].Find(Cells(x, 2), Lookat:=xlWhole)
     If Not s Is Nothing Then
      frst = s.Address
      Do
       s.Interior.ColorIndex = c + 33
       Set s = [B:B].FindNext(s)
      Loop While Not s Is Nothing And s.Address <> frst
     End If
    End If
    c = c + 1
   End If
  Next x
End Sub
Pegorini agradeceu por isso
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord