I made a couple of changes.
I advise you to add the Option Explicit at the top of your modules to force variable declaration, this would prevent a couple of errors. (Tools, Options, second checkbox)
Option Explicit
Sub copyandpastecolumns()
Dim directoryPath As String
Dim filepath As String
Dim filename As String
Dim Lastrow As Long
Dim Lastcolumn As Long
Dim erow As Long
directoryPath = "C:\Users\piete\Documents\"
filepath = directoryPath & "*.xlsx"
filename = Dir(filepath)
MsgBox ("hi")
Do While Len(filename) > 0
'Think these are not needed
' If filename = "workbook6.xlsx" Then
' Exit Sub
' End If
MsgBox ("hi2")
Workbooks.Open directoryPath & filename
Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Lastcolumn = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
Range(Cells(2, 1), Cells(Lastrow, Lastcolumn)).Copy
ActiveWorkbook.Close
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Cells(erow, 1)
MsgBox ("hi2")
'Note the parentheses and use of the correct variable:
filename = Dir()
Loop
End Sub