Forum Discussion

renee_crozier's avatar
renee_crozier
Brass Contributor
Apr 17, 2024
Solved

Find, Select Row, and Select up to Row 1 Using VBA Code

Using VBA code, I'm looking to use the Find and Replace dialogue box, find a certain item, select the entire row of data, and then select all the way up to row 1 and then copy it.   For this, I am ...
  • HansVogelaar's avatar
    Apr 17, 2024

    renee_crozier 

    The following does not select the range, but it does copy it, ready to be pasted elsewhere:

        Dim rng As Range
        Set rng = Cells.Find(What:=":", After:=ActiveCell, LookIn:=xlFormulas, _
                LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                MatchCase:=False, SearchFormat:=False)
        Range(Range("A1"), rng).EntireRow.Copy

Resources