Forum Discussion

roboed's avatar
roboed
Copper Contributor
Jun 08, 2022
Solved

Macro to copy/paste to a specific cell

Hi. Need some guiding here...   Assume the following data in normal cells (not a table). Data is generated via various drop-downs and formulas etc.     A B 1 Unique ID Data 2 555 D...
  • HansVogelaar's avatar
    Jun 08, 2022

    roboed 

    Sub CopyData()
        Dim rng As Range
        Set rng = ActiveSheet.ListObjects("Table1").ListColumns("Unique ID").DataBodyRange.Find(What:=Range("A2").Value, LookAt:=xlWhole)
        If rng Is Nothing Then
            Beep
        Else
            Range("A2:B3").Copy Destination:=rng
            Application.CutCopyMode = False
        End If
    End Sub

Resources