Results 1 to 5 of 5

Thread: VBA code does not perform any action

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    snb
    Guest
    MS prevented this in the listobject design.
    Avoid reading more than once from a worksheet.
    Exploit Excel's built-in options like advancedfilter.

    This will suffice:
    Sub M_snb()
      Sheet2.Cells(1, 2).Resize(, 7) = Application.Index(Sheet1.ListObjects(1).HeaderRowRange.Value, 1, Array(11, 20, 17, 26, 34, 35, 41))
      Sheet1.ListObjects(1).Range.AdvancedFilter 2, , Sheet2.Cells(1, 2).CurrentRegion
    End Sub
    Attached Files Attached Files
    Last edited by snb; 04-28-2022 at 03:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •