Ir para conteúdo
Fórum Script Brasil
  • 0

Macro que preenche a linha conforme a data


murilocanaan

Pergunta

Montei uma Macro para ela buscar o dado de acordo com a data correspondente, no entanto, ela não está puxando da respectiva linha, como faço neste caso para ela buscar exatamente na linha em que a macro foi executada.

O problema está na linha que tem asterisco, a celula deveria variar conforme a linha. Valeu pessoal.

Selection.Find(What:=Range("gp8"),

Sub Macro8()

'

' Macro8 Macro

'

' Atalho do teclado: Ctrl+d

'

Selection.End(xlToRight).Select

ActiveCell.Offset(0, 1).Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select

Range(Selection, Selection.End(xlToRight)).Select

ActiveCell.Range("A1:BT1").Select

Selection.ClearContents

Selection.End(xlToLeft).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToRight).Select

Selection.End(xlToLeft).Select

Selection.End(xlToLeft).Select

Selection.Copy

Selection.End(xlToLeft).Select

Range(Selection, Selection.End(xlToLeft)).Select

* Selection.Find(What:=ActiveCell.Range("gp8"), After:=ActiveCell, LookIn:=xlValues, _

LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _

MatchCase:=False, SearchFormat:=False).Activate

ActiveCell.Offset(0, -111).Range("A1").Select

Application.CutCopyMode = False

ActiveCell.FormulaR1C1 = "100%"

ActiveCell.Select

Selection.End(xlToLeft).Select

ActiveCell.Offset(0, -1).Range("A1").Select

End Sub

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...