Vídeo recomendado
https://youtu.be/diWPPPhW-9E

ERRO EM TEMPO DE EXECUÇÃO '94"' USO DE 'NULL" INVÁLIDO Empty ERRO EM TEMPO DE EXECUÇÃO '94"' USO DE 'NULL" INVÁLIDO

Fórum para dúvidas sobre os fundamentos da linguagem de programação Visual Basic no contexto do VBA
PauinhoTuca
Acabou de chegar
Acabou de chegar
Mensagens: 2
Registrado em: Ter Fev 09, 2021 10:27 pm

ERRO EM TEMPO DE EXECUÇÃO '94"' USO DE 'NULL" INVÁLIDO Empty ERRO EM TEMPO DE EXECUÇÃO '94"' USO DE 'NULL" INVÁLIDO

Mensagem por PauinhoTuca »

Código: Selecionar todos

Sub Editar()

bloqueado = True
Dim tabela As ListObject
Dim n As Integer, l As Integer
Set tabela = Planilha1.ListObjects(1)

n = UserForm2.ListBox1.Value
l = tabela.Range.Columns().Find(n, , , xlWhole).Row

tabela.Range(l, 2).Value = UserForm2.txtorcamento.Value
tabela.Range(l, 3).Value = UserForm2.txtdata.Value
tabela.Range(l, 4).Value = UserForm2.txtHora.Value
tabela.Range(l, 5).Value = UserForm2.cbbVendedor.Value
tabela.Range(l, 6).Value = UserForm2.txtcliente.Value
tabela.Range(l, 7).Value = UserForm2.txtcidade.Value
tabela.Range(l, 8).Value = UserForm2.txtuf.Value

tabela.Range(l, 9).Value = IIf(UserForm2.obpadrao, "Padrão", "Fora de Padrão")      < AQUI APARECE O ERRO

tabela.Range(l, 10).Value = UserForm2.cbbProduto.Value
tabela.Range(l, 11).Value = UserForm2.txtcapacidade.Value
tabela.Range(l, 12).Value = UserForm2.txtpreco.Value
tabela.Range(l, 13).Value = UserForm2.txtContato.Value
tabela.Range(l, 14).Value = UserForm2.txttelefone.Value
tabela.Range(l, 15).Value = UserForm2.txtcelular.Value
tabela.Range(l, 16).Value = UserForm2.txtemail.Value
tabela.Range(l, 17).Value = UserForm2.cbbStatus.Value
tabela.Range(l, 18).Value = UserForm2.txtDataDeRetorno.Value
tabela.Range(l, 19).Value = UserForm2.txtObs.Value

Call atualizar_listbox
MsgBox "O Registro foi atualizado"

bloqueado = False

End Sub

Boa noite, não sei como resolver este erro alguem pode me auxiliar, arquivo em anexo
Anexos
Cópia de relação de produtos - março (1).rar
(72.07 KiB) Baixado 146 vezes


Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


Avatar do usuário
Reinaldo
Jedi
Jedi
Mensagens: 1537
Registrado em: Sex Ago 01, 2014 4:09 pm
Localização: Garça - SP / SCS - SP

Re: ERRO EM TEMPO DE EXECUÇÃO '94"' USO DE 'NULL" INVÁLIDO Empty ERRO EM TEMPO DE EXECUÇÃO '94"' USO DE 'NULL" INVÁLIDO

Mensagem por Reinaldo »

Uma possibilidade:

Código: Selecionar todos

...
tabela.Range(n, 5).Value = UserForm2.cbbVendedor.Value
tabela.Range(n, 6).Value = UserForm2.txtcliente.Value
tabela.Range(n, 7).Value = UserForm2.txtcidade.Value
tabela.Range(n, 8).Value = UserForm2.txtuf.Value
'tabela.Range(n, 9).Value = IIf(UserForm2.obpadrao, "Padrão", "Fora de Padrão")
If UserForm2.obpadrao = True Then
    tabela.Range(n, 9).Value = "Padrão"
Else
    tabela.Range(n, 9).Value = "Fora de Padrão"
End If
tabela.Range(n, 10).Value = UserForm2.cbbProduto.Value
tabela.Range(n, 11).Value = UserForm2.txtcapacidade.Value
tabela.Range(n, 12).Value = UserForm2.txtpreco.Value
...


Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


Responder