Página 1 de 1

Problemas no preenchimento automático do formulario

Enviado: 22 Jan 2016 às 10:24
por ThiagoCarlotto10
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.

Problemas no preenchimento automático do formulario

Enviado: 22 Jan 2016 às 10:32
por ThiagoCarlotto10
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

Problemas no preenchimento automático do formulario

Enviado: 22 Jan 2016 às 13:00
por ThiagoCarlotto10
Help!