Ir para conteúdo
Fórum Script Brasil

JoséA

Membros
  • Total de itens

    114
  • Registro em

  • Última visita

Posts postados por JoséA

  1. 'QUANDO O ITEM É CLICADO NO LISTBOX, FOCA NA CÉLUAL CORRESPONDENTE
    Private Sub listBox1_Click()
    
          Dim Employee As Variant
          Dim Name As String
          Dim firstaddress As String
          
          Employee = Empty
          'SE PRECISAR MAIS DE 500 LINHAS É SÓ ALTERAR ABAIXO
          With ActiveSheet.Range("a1:a500")
                Name = ListBox1.Value
                Set Employee = .Find(what:=Name, LookIn:=xlValues)
                If Not Employee Is Nothing Then Employee.Rows.EntireRow.Select Else Exit Sub
          End With
          'FECHA O FORM QUANDO CLICA NO NOME
          'Unload Me
          Set Employee = Nothing
    'OPCIONAL MOSTRA O ITEM SELECIONADO NA CELULA PARTINDO DE A
    Range("I1") = ListBox1.Value
    End Sub

  2. Tente assim...

    Sub Data()
        Cells.Find(What:=CDate(Date), After:=ActiveCell, LookIn:=xlFormulas, _
            LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Activate
    End Sub

  3. Porque na sua macro há uma instrução para selecionar uma área da Plan "Análise MOV"

    Sheets("Análise MOV").Cells(i, "C").Select
    Para resolver o caso insira que ative a Plan "Análise MOV" e depois retorne para Plan desejada.
    Sub InsereLinha()
    Dim i As Long
    For i = 50007 To 1 Step -1
    If Sheets("Análise MOV").Cells(i, "C") = Sheets("Config").Cells(3, "I") Then
    Sheets("Análise MOV").Select
    Sheets("Análise MOV").Cells(i, "C").Select
    Selection.EntireRow.Insert
    Sheets("Config").Cells(3, "I").Copy
    Selection.PasteSpecial Paste:=xlPasteValues
    Sheets("Config").Cells(3, "J").Copy
    ActiveCell.Offset(0, 1).PasteSpecial Paste:=xlPasteValues
    Sheets("Config").Select
    Exit Sub
    End If
    Next i
    End Sub

  4. deu certo mas eu reparei que quando a linha da Listbox e selecionada e a linha vai para textbox quando eu vou modificar alguma coisa o sistema não deixa eu modificar só quando agente pede para pesquisar ai eu usei aquele codigo que você me falou ai da tudo certo, tem jeito de selecionar a listbox ele envia para as textbox e eu mudar ela aceitar essa mudança...

    Não entendí...

  5. Desculpe-me pela demora é que só agora sobrou um tempo.

    Usando a mesma lógica da sua pesquisa bastaria inverter a ordem, tipo:

    'Verificar se foi digitado um nome na primeira caixa de texto
    If txt_pesq_cheque_cheque.Text = "" Then
    MsgBox "Digite um Cheque de um cliente"
    txt_pesq_cheque_cheque.SetFocus
    GoTo Linha4
    End If
    With Worksheets("CHEQUE").Range("a:a")
    Set C = .Find(txt_pesq_cheque_cheque.Value, LookIn:=xlValues, LookAt:=xlPart)
    If Not C Is Nothing Then
    C.Activate
    C.Value = txt_pesq_cheque_cheque.Value
    C.Offset(0, 1).Value = txt_pesq_cheque_valor.Value
    C.Offset(0, 2).Value = txt_pesq_cheque_matricula.Value
    C.Offset(0, 3).Value = txt_pesq_cheque_emissao.Value
    C.Offset(0, 4).Value = txt_pesq_cheque_compensacao.Value
    C.Offset(0, 7).Value = txt_pesq_cheque_descricao.Value
    C.Offset(0, 6).Value = cbo_pesq_cheque_oficio.Value
    C.Offset(0, 5).Value = txt_pesq_cheque_situacao.Value
    MsgBox "Dado alterado com sucesso"
    Else
    
    MsgBox "Cheque não encontrado!"
    End If
    
    End With
    Linha4:

    Em tempo...

    Utilizei como exemplo o seu frm_pesquisa_cheque.

  6. 'bsp.com',

    Seja bem vindo ao fórum.

    Tente assim:

    Private Sub ComboBox1_Change()
    LINHA = ComboBox1.ListIndex + 1
    TextBox1.Value = Plan1.Range("B2:B65000").Item(LINHA)
    TextBox2.Value = Plan1.Range("C2:C65000").Item(LINHA)
    TextBox3.Value = Plan1.Range("D2:D65000").Item(LINHA)
    End Sub

×
×
  • Criar Novo...