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.
#6755
Bom dia!

Estou montando um sistema aqui para minha empresa, no entanto estou com uma dificuldade.
Gostaria que quando fosse gerado o documento na aba "capa" nova ordem de saída, sempre assumisse o ultimo dado inserido, quando gerado o PDF no campo visualização, pois com a formula que coloquei "índice" esta sempre assumindo o ultimo dado, mas se não preencho algum campo do formulário, ele busca a anterior.
Gostaria de ajuda para corrigir este problema, e também alguma maneira de avisar se o pdf já estivesse aberto no campo visualizar para não dar erro.
Você não está autorizado a ver ou baixar esse anexo.
#6756
teria que ser algum gatilho que se não preenchese o campo no formulario, assumi-se algum valor tipo 0 (zero)...

Private Sub camondoinserir_Click()
'ativar primeira planilha
ThisWorkbook.Worksheets("cadastro").Activate
'Selecionar a célula B3
Range("c5").Select

'Procurar a primeira célula vazia
Do
If Not (IsEmpty(ActiveCell)) Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True

'Carregar os dados digitados nas caixas de texto para a planilha
ActiveCell.Value = txtdataregistro.Value
ActiveCell.Offset(0, 1).Value = txtordemservico.Value
ActiveCell.Offset(0, 2).Value = Combooficina.Value
ActiveCell.Offset(0, 3).Value = Comboequipamento.Value
ActiveCell.Offset(0, 4).Value = txtespecificaequip.Value
ActiveCell.Offset(0, 5).Value = Combomarca.Value
ActiveCell.Offset(0, 6).Value = txtserie.Value
ActiveCell.Offset(0, 7).Value = txtpatrimonio.Value
ActiveCell.Offset(0, 8).Value = txtdefeito.Value
ActiveCell.Offset(0, 9).Value = Comboorigem.Value
ActiveCell.Offset(0, 10).Value = txtlocal.Value
ActiveCell.Offset(0, 11).Value = txtsolicitante.Value
ActiveCell.Offset(0, 12).Value = txtcontatoraml.Value
ActiveCell.Offset(0, 13).Value = txtempresaconserto.Value
ActiveCell.Offset(0, 14).Value = txtosempresa.Value
ActiveCell.Offset(0, 15).Value = txtcontatofone.Value
ActiveCell.Offset(0, 16).Value = txtdatasaida.Value
ActiveCell.Offset(0, 17).Value = txtmotorista.Value
ActiveCell.Offset(0, 18).Value = txtnf.Value
ActiveCell.Offset(0, 19).Value = txtretorno.Value
ActiveCell.Offset(0, 20).Value = txtdatachegada.Value
ActiveCell.Offset(0, 21).Value = txtobservacao.Value






'Colocar o foco na primeira caixa de texto
txtdataregistro.SetFocus


' apos inserir voltar para inicio
Sheets("capa").Select
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