title: Macro to copy column data into another worksheet till the last row of data in the source sheet
body: <p>I am trying to copy data from source sheet to another sheet TILL the LAST ROW OF DATA.
  How can I limit macro till the last row of data. Below is the macro that is created to get the data.</p>
  
  <p>' Sub ABringData()
  '
  ' BringData Macro
  '
  '
  Sub ABringData()</p>
  
  <pre><code>Columns("G:G").Select
  Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
  Range("G1").Select
  ActiveCell.FormulaR1C1 = "=Data!RC[-4]"
  Range("G2").Select
  Columns("G:G").EntireColumn.AutoFit
  Range("G1").Select
  Selection.AutoFill Destination:=Range("G:G")
  Range("G:G").Select
  Columns("G:G").EntireColumn.AutoFit
  Columns("G:G").Select
  With Selection.Font
      .Color = -16776961
      .TintAndShade = 0
  End With
  Columns("AA:AA").Select
  Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
  Range("AA1").Select
  ActiveWindow.SmallScroll ToRight:=1
  ActiveCell.FormulaR1C1 = "=Data!RC[-20]"
  Range("AA1").Select
  Selection.AutoFill Destination:=Range("AA:AA")
  Range("AA:AA").Select
  With Selection
      .HorizontalAlignment = xlLeft
      .VerticalAlignment = xlBottom
      .WrapText = False
      .Orientation = 0
      .AddIndent = False
      .IndentLevel = 0
      .ShrinkToFit = False
      .ReadingOrder = xlContext
      .MergeCells = False
  End With
  With Selection.Font
      .Color = -16776961
      .TintAndShade = 0
  End With
  ActiveWindow.SmallScroll ToRight:=-12
  Columns("G:G").Select
  With Selection
      .HorizontalAlignment = xlLeft
      .VerticalAlignment = xlBottom
      .WrapText = False
      .Orientation = 0
      .AddIndent = False
      .IndentLevel = 0
      .ShrinkToFit = False
      .ReadingOrder = xlContext
      .MergeCells = False
  End With
  Range("G4").Select
  </code></pre>
  
  <p>End Sub</p>