title: Copy certain excel columns based on ones criteria
body: <p>First thing I did was create a button that would copy certain cells using this code:</p>
  
  <blockquote>
    <p>Worksheets("Sheet1").Range("A:A,B:B,D:D").Copy _ 
    and it worked fine.</p>
  </blockquote>
  
  <p>Second, I found the code that would copy all details in a row based on the criteria of one, in this case if there was an "A" in the "Location" column.</p>
  
  <blockquote>
    <p>Private Sub ENTIREROW_Click()
    'Sub copyrows()</p>
    
    <p>Dim i As Range, Cell As Object</p>
    
    <p>Set i = Range("D:D") 'Substitute with the range which includes your True/False values</p>
    
    <p>For Each Cell In i</p>
  
  <pre><code>   If IsEmpty(Cell) Then
         Exit Sub
     End If
  
     If Cell.Value = "A" Then
         Cell.ENTIREROW.Copy
         Sheet2.Select 'Substitute with your sheet
         ActiveSheet.Range("A65536").End(xlUp).Select
         Selection.Offset(1, 0).Select
         ActiveSheet.Paste
     End If
  </code></pre>
    
    <p>Next</p>
    
    <p>End Sub</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/iZYnx.png" alt="Spreadsheet data"></p>
  
  <p>My question is, how do I copy all information in the specified columns (A,B,D) where there is an "A" in "Location" in one button. </p>
  
  <p>Furthermore, this is my example data, the sheet I will actually use this on has 34 columns to copy. Is there a more efficient way of setting a range when you don't want an entire sequence, everything but the data in column C?</p>
  
  <p>Thanks in advance and apologies for my explanation skills.</p>