Forum Discussion

ITTom365's avatar
ITTom365
Brass Contributor
Mar 14, 2023
Solved

ListRows.Add.Range (Values only)

Hello all    I  need to copy the databody range from one table to another but only the values.    I would ordinarily use listRows.Add.Range  e.g.  MySourceTable.DataBodyRAnge.Copy MyDestinatio...
  • HansVogelaar's avatar
    HansVogelaar
    Mar 14, 2023

    ITTom365 

    You're correct - the clipboard gets cleared. Try this:

        Dim NumRows As Long
        Dim i As Long
        NumRows = MySourceTable.ListRows.Count
        For i = 1 To NumRows
            MyDestinationTable.ListRows.Add.Range.Value = MySourceTable.ListRows(i).Range.Value
        Next i

Resources