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 vellonalves
#49069
Boa Noite!

Estou criando uma logica onde eu verificado o Match de uma coluna e jogo em uma variavel e faço um if onde se essa variavel do match for > 0 realiza uma logica porem esta dando um erro de type mismatch.
Segue o codigo
Dim zero As Double
zero = 0
i = 7

While i < 21

codigo = Worksheets("Interface").Range("G" & i)
onde = Application.Match(codigo, Worksheets("Estoque").Columns(5), 0)
If onde > zero Then
Worksheets("Estoque").Range("A" & onde).Copy
ActiveSheet.Paste Destination:=Worksheets("Interface").Range("G" & i)


Worksheets("Estoque").Range("B" & onde).Copy
ActiveSheet.Paste Destination:=Worksheets("Interface").Range("I" & i)


Worksheets("Interface").Range("F" & i) = "1"


Else
onde2 = Application.Match(codigo, Worksheets("Estoque").Columns(1), 0)

Worksheets("Estoque").Range("A" & onde2).Copy
ActiveSheet.Paste Destination:=Worksheets("Interface").Range("G" & i)


Worksheets("Estoque").Range("B" & onde2).Copy
ActiveSheet.Paste Destination:=Worksheets("Interface").Range("I" & i)



Worksheets("Interface").Range("F" & i) = "1"
End If

Wend
Agradeço desde já
Por babdallas
#49083
Anexa uma pasta de trabalho de exemplo, por favor.
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