' === Exemplo Guiado (ATIVO) ===
? UCase(Trim("   carlos eduardo da silva   "))

' === Pratica Obrigatoria 1 (COMENTADO PARA EVITAR CONFLITO) ===
'Option Explicit
'
'Sub CadastrarMotoristaFinal()
'    Dim strNome As String
'    Dim strPlaca As String
'    Dim strCNH As String
'    Dim strEmail As String
'    Dim intResp As VbMsgBoxResult
'    Dim lngLinha As Long
'    Dim ws As Worksheet
'    
'    Set ws = ThisWorkbook.Worksheets(1)
'    
'    ' 1. Entrada e Limpeza de Nome
'    strNome = UCase(Trim(InputBox("Nome Completo do Motorista:", "Cadastro FastLog")))
'    If strNome = "" Then Exit Sub
'    
'    ' 2. Entrada e Limpeza da Placa
'    strPlaca = UCase(Replace(Replace(Trim(InputBox("Placa do Veículo:", "Cadastro FastLog")), "-", ""), " ", ""))
'    If Len(strPlaca) <> 7 Then
'        MsgBox "Placa inválida! Deve possuir exatamente 7 caracteres.", vbCritical, "Erro de Validação"
'        Exit Sub
'    End If
'    
'    ' 3. Entrada da CNH
'    strCNH = Trim(InputBox("Número da CNH:", "Cadastro FastLog"))
'    If strCNH = "" Then Exit Sub
'    
'    ' 4. Validação de E-mail com InStr (Desafio de Fixação)
'    strEmail = LCase(Trim(InputBox("E-mail para comprovante:", "Cadastro FastLog")))
'    If InStr(strEmail, "@") = 0 Or InStr(strEmail, ".") = 0 Then
'        MsgBox "Formato de e-mail inválido! Deve conter '@' e ponto.", vbCritical, "Erro de Validação"
'        Exit Sub
'    End If
'    
'    ' 5. Confirmação
'    intResp = MsgBox("Confirma a inclusão do motorista?" & vbCrLf & vbCrLf & _
'                     "Nome: " & strNome & vbCrLf & _
'                     "Placa: " & strPlaca & vbCrLf & _
'                     "CNH: " & strCNH & vbCrLf & _
'                     "E-mail: " & strEmail, _
'                     vbYesNo + vbQuestion, "Confirmar Gravação")
'                     
'    If intResp = vbYes Then
'        lngLinha = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row + 1
'        ws.Cells(lngLinha, 1).Value = lngLinha - 1
'        ws.Cells(lngLinha, 2).Value = strNome
'        ws.Cells(lngLinha, 3).Value = strPlaca
'        ws.Cells(lngLinha, 4).Value = strCNH
'        ws.Cells(lngLinha, 5).Value = strEmail
'        ws.Cells(lngLinha, 6).Value = Now
'        ws.Cells(lngLinha, 6).NumberFormat = "dd/mm/yyyy hh:mm:ss"
'        
'        ws.Columns("A:F").AutoFit
'        MsgBox "Motorista gravado com sucesso no registro " & (lngLinha - 1) & "!", vbInformation, "Sucesso"
'    End If
'End Sub

