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.
  • Avatar do usuário
Por vilc
Posts
#71519
Boa noite, estou com uma planilha e quando tento filtrar só por números ela não filtra, mas se eu colocar uma letra ela filtra, segue em anexo a planilha, desde já agradeço.
Você não está autorizado a ver ou baixar esse anexo.
Avatar do usuário
Por Foxtri
Posts Avatar
#71535
Boa tarde.
Use o seguinte código:


'filtra pelo nº de serie

Private Sub TextBox1_Change()
Dim Rng As Range, Xval, XRng, Xlin
Application.ScreenUpdating = False
XRng = CStr(TextBox1.Value)
For Each Rng In ActiveSheet.ListObjects("Tabela3").ListColumns(1).DataBodyRange
Xval = CStr(Rng.Value)
If Not CBool(InStr(1, Xval, XRng, vbBinaryCompare)) Then
If Xval <> "" Then
Xlin = Rng.Row
Rows(Xlin).Hidden = True
End If
Else
Xlin = Rng.Row
Rows(Xlin).Hidden = False
End If
Next Rng
Application.ScreenUpdating = True
End Sub

Até
Foxtri
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