Results 1 to 9 of 9

Thread: How to cycle through control sheet in workbook

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Whoops, thanks for picking that up. I have changed the column on the right to Bigpeer and I fixed up the code but I still have the same error code for the same line of code:

    Sub Peers()
    Dim Tickers As Variant, Ticker As Variant, Bigpeers As Variant, Bigpeer As Variant, Rows As Long
    Rows = Sheets("Control").Cells(Sheets("Control").Rows.Count, "DA").End(xlUp).Row
    Tickers = Sheets("Control").Range("B1:B" & Rows)
    Bigpeers = Sheets("Control").Range("E1:E" & Rows)
    Dim ws As Worksheet
    Set ch = New Selenium.ChromeDriver
    Set ks = New Selenium.Keys
    Bigpeers = Sheets("Control").ListObjects("Bigpeers").ListColumns("Bigpeer").DataBodyRange.Value
    Tickers = Sheets("Control").ListObjects("Tickers").ListColumns("Ticker").DataBodyRange.Value
    For Each Bigpeer In Bigpeers
      Set ws = ThisWorkbook.Worksheets(Ticker)
      Range("AB1:AL300").Select
      Selection.Copy
        For Each Ticker In Tickers
            Set ws = ThisWorkbook.Worksheets(Bigpeer)
            ws.Range("AN1").PasteSpecial
        Next Ticker
    Next Bigpeer
    End Sub
    The attached image is the updated control sheet
    control1.jpg
    Attached Images Attached Images
    Last edited by Aussiebear; 01-05-2023 at 08:07 PM. Reason: Reduction of whitespace in submitted code

Posting Permissions

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