title: VBA check if columns are the same
body: <p>I have two Sheets in Excel that I need to check if the columns are the same in both sheets before processing them. </p>
  
  <p>I have created a macro to do this check, but I'm wondering if there is a better way to achieve this.</p>
  
  <pre><code>Sub CheckColumns()
  
  Sheets("Source1").Select
  Range("A1").Select
  Range(Selection, Selection.End(xlToRight)).Select
  Selection.Copy
  Sheets("Sheet1").Select
  Range("A1").Select
  ActiveSheet.Paste
  Sheets("Source2").Select
  Range("A1").Select
  Range(Selection, Selection.End(xlToRight)).Select
  Selection.Copy
  Sheets("Sheet1").Select
  Range("A2").Select
  ActiveSheet.Paste
  Range("A3") = "=IF(A1=A2,0,1)"
  Range("A3").Copy
  Range("A2").Select
  Selection.End(xlToRight).Select
  ActiveCell.Offset(1, 0).Range("A1").Select
  Range(Selection, Selection.End(xlToLeft)).Select
  ActiveSheet.Paste
  Range("A4") = "=SUM(3:3)"
  If Range("A4").Value = 0 Then
      MsgBox "Same Columns"
  Else
      MsgBox "different Columns"
  End If
  
  End Sub
  </code></pre>