title: VBA error not selection and deleting columns
body: <p>Today with VBA I was trying to come with something that would modify several .xlsx files in a folder and then would copy and paste the data to another worksheet. In one of the steps, I am trying to select and delete specific columns from the other Excel file based on headers' names in VBA. The columns I would like to remove are all between the headers named &quot;Unsubscribed&quot; and &quot;Webinar Question 1&quot;. The issue is that when it come to this part, it gives me an error 91:</p>
  <pre><code>With Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;)
      Range(Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;).Find(What:=&quot;Unsubscribed&quot;, LookIn:=xlValues, MatchCase:=False).Offset(0, 1), _
          Cells(Worksheets(&quot;Sheet0&quot;).Cells(Worksheets(&quot;Sheet0&quot;).Rows.Count, &quot;A&quot;).End(xlUp).Row, _
          Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;).Find(What:=&quot;Webinar Question 1&quot;, LookIn:=xlValues, MatchCase:=False).Offset(0, -1).Column) _
      ).Select
  End With
  </code></pre>
  <p>The whole VBA is:</p>
  <pre><code>    Private Sub CommandButton1_Click()
  
      Dim my_files As String
      Dim folder_path As String
      Dim wb As Workbook, lRow As Long
      Dim ws As Worksheet, LR As Long
      Dim wsCopy As Worksheet
      Dim wsDest As Worksheet
      Dim lCopyLastRow As Long
      Dim lDestLastRow As Long
  
      folder_path = &quot;C:\Users\XXXX\Desktop\&quot;
      my_files = Dir(folder_path &amp; &quot;\*.xlsx&quot;)
  
  Do While my_files &lt;&gt; vbNullString
  
  Set wb = Workbooks.Open(folder_path &amp; &quot;\&quot; &amp; my_files)
  Set ws = wb.Worksheets(&quot;Sheet0&quot;)
  
  
  'INSERT COLUMN AND PASTE FILE NAME IN ALL ROWS UNTIL LAST ROW
  LR = ws.Range(&quot;B9&quot;).End(xlDown).Row
  ws.Columns(1).Select
  ActiveCell.EntireColumn.Insert
  ws.Range(&quot;A8&quot;).Value = &quot;Title&quot;
  ws.Range(&quot;A9:A&quot; &amp; LR).Value = ActiveWorkbook.Name
  
  
  'INSERT COLUMN AND PASTE CELL A5 VALUE IN ALL ROWS UNTIL LAST ROW
  ws.Columns(2).Select
  ActiveCell.EntireColumn.Insert
  ws.Range(&quot;B8&quot;).Value = &quot;Duration&quot;
  ws.Range(&quot;B9:B&quot; &amp; LR).Value = ws.Range(&quot;E5&quot;).Value
  
  
  'DELETE A1:A7 ROWS
  ws.Range(&quot;A1:A7&quot;).EntireRow.Delete
  
  
  'DELETE ORGANIZATION COLUMN
  Dim rng As Range
  With Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;)
      Set rng = Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;).Find(What:=&quot;Organization&quot;, _
          lookat:=xlWhole, MatchCase:=False)
      Do While Not rng Is Nothing
          rng.EntireColumn.Delete
          Set rng = .FindNext
      Loop
  End With
  
  'SELECT AND DELETE ALL COLUMNS BETWEEN UNSUBSCRIBED AND WEBINAR QUESTION 1
  With Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;)
      Range(Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;).Find(What:=&quot;Unsubscribed&quot;, LookIn:=xlValues, MatchCase:=False).Offset(0, 1), _
          Cells(Worksheets(&quot;Sheet0&quot;).Cells(Worksheets(&quot;Sheet0&quot;).Rows.Count, &quot;A&quot;).End(xlUp).Row, _
          Worksheets(&quot;Sheet0&quot;).Range(&quot;A1:BB1&quot;).Find(What:=&quot;Webinar Question 1&quot;, LookIn:=xlValues, MatchCase:=False).Offset(0, -1).Column) _
      ).Select.Delete
  End With
  
  Set wsCopy = Worksheets(&quot;Sheet0&quot;)
  Set wsDest = Workbooks(&quot;Book1.xlsm&quot;).Worksheets(&quot;Sheet2&quot;)
  
  lCopyLastRow = ws.Cells(ws.Rows.Count, &quot;A&quot;).End(xlUp).Offset(1).Row
  lDestLastRow = wsDest.Cells(wsDest.Rows.Count, &quot;A&quot;).End(xlUp).Offset(1).Row
  
  wsCopy.Range(&quot;A2:BB1&quot; &amp; lCopyLastRow).Copy _
  wsDest.Range(&quot;A&quot; &amp; lDestLastRow)
  
  wb.Close True
  my_files = Dir()
  
  Loop
  
  MsgBox (&quot;All Files Are Updated&quot;)
  
  End Sub
  </code></pre>
  <p>For clarification, the worksheet where I have the VBA has Sheet1 and Sheet2, and the file that i am modifying has Sheet0.</p>
  <p>What am I missing? Thank you very much and have a nice day.</p>