title: Copy and Paste Selected Columns to End of Table in Excel with VBA
body: <p>Within the same worksheet I have a single table, and each time I add new data I need to copy the last 4 columns of this table to the right end of that same table so I can add new data. The main reason being I always want to keep the same format and some columns have dropdown lists and formulas.</p>
  
  <p>I found the next code in the website below. It works really well for copy/pasting 
  rows, so I tried to modify the code to do it for columns but I couldn´t manage. </p>
  
  <p>I´m new to VBA and just starting to learn how to program macros, so any feedback on what I could do would be appreciated.</p>
  
  <p><a href="https://www.contextures.com/exceltablemacrocopyitems.html" rel="nofollow noreferrer">https://www.contextures.com/exceltablemacrocopyitems.html</a></p>
  
  <pre><code>Sub CopySelectionVisibleRowsEnd()
  Dim ws As Worksheet
  Dim mySel As Range
  Dim lRow As Long
  Dim lRowNew As Long
  Dim lRowsAdd As Long
  Dim myList As ListObject
  Dim myListRows As Long
  Dim myListCols As Long
  
  Set ws = ActiveSheet
  Set mySel = Selection.EntireRow
  Set myList = ActiveCell.ListObject
  myListRows = myList.Range.Rows.Count
  myListCols = myList.Range.Columns.Count
  lRow = ws.Cells.Find(What:="*", _
          SearchOrder:=xlRows, _
          SearchDirection:=xlPrevious, _
          LookIn:=xlValues).Row + 1
  
  mySel.SpecialCells(xlCellTypeVisible).Copy
  ws.Cells(lRow, 1).PasteSpecial Paste:=xlPasteAll
  
  lRowNew = ws.Cells.Find(What:="*", _
          SearchOrder:=xlRows, _
          SearchDirection:=xlPrevious, _
          LookIn:=xlValues).Row + 1
  lRowsAdd = lRowNew - lRow
  
  With myList
      .Resize ws.Range(.Range.Resize(myListRows + lRowsAdd, myListCols).Address)
  End With
  
  Application.CutCopyMode = False
  End Sub
  </code></pre>