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
#51954
Olá Pessoal
Estou fazendo uma planilha de calculo de impostos para comparação de preços, e está dando erro na execução da macro ( ao clicar em lançar, Aba Painel), dizendo que a linha que é para determinar se é um serviço ou mercadoria e jogar na aba dados , esta ficando amarela a linha do código e a macro para de funcionar ( aparece um seta amarela)

If shtpainel.Range("Mercadoria") = "" Then
-> shtdados.Cells(linha, "b") = shtpainel.Range("Serviço").Value
shtdados.Cells(linha, "C") = "Serviço"





Grato
Você não está autorizado a ver ou baixar esse anexo.
#51957
Descobri que erro era o falto de não ter dado nome aos campos na aba Painel, agora que coloque os nome re escrevi e está dando erro na sequência dos "IFs"

E como coloco uma mensagem após clicar "Lançar", de a mensagem "OK" ?

E colocar um comando para linda a aba " Dados " quando houver a necessidade de por um novo valor ?

Grato


If shtpainel.Range("Merdadoria") = "" Then
shtdados.Cells(linha, "b") = shtpainel.Range("Serviço").Value
shtdados.Cells(linha, "b") = "Despesa"
Else
shtdados.Cells(linha, "b") = shtpainel.Range("Mercadoria").Value
shtdados.Cells(linha, "b") = "Mercadoria"
End If
shtdados.Cells(linha, "d") = shtpainel.Range("estado").Value

Else if
shtdados.Cells(linha, "e") = shtpainel.Range("localmatl").Value
Else
shtdados.Cells(linha, "f") = shtpainel.Range("tipomatl").Value

Else
shtdados.Cells(linha, "g") = shtpainel.Range("unidade").Value
Else
shtdados.Cells(linha, "h") = shtpainel.Range("cidadeIss").Value
Else
shtdados.Cells(linha, "i") = shtpainel.Range("tiposerviss").Value

Else
shtdados.Cells(linha, "j") = shtpainel.Range("meitiposerv").Value


Else
shtdados.Cells(linha, "k") = shtpainel.Range("tiposervirrf").Value


Else
shtdados.Cells(linha, "l") = shtpainel.Range("matlicms").Value

shtpainel.Shapes("Barra de Rolagem").Visible = True
Você não está autorizado a ver ou baixar esse anexo.
#51960
Só elseif não funciona, nem apena else.
if "condição" then
"condições"
Elseif "condição" then
"condições"
Elseif "condição" then
"condições"
end if
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