Jump to content
Fórum Script Brasil
  • 0

Macro que preenche a linha conforme a data


murilocanaan

Question

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 to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...