Wow thanks for the fast reply!!
The code works perfectly.
My final code looks like this now:
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim LastRow As Long
Dim LastCol As Long
Dim dailyrecap As String
Dim dailyrecapwb As Workbook
Dim destSheet As Worksheet
dailyrecap = Application.GetOpenFilename("CSV Files (.csv), *.csv", , "Please select daily recap")
Workbooks.Open (dailyrecap)
Set dailyrecapwb = Workbooks.Open(dailyrecap, Local:="true")
Set destSheet = ThisWorkbook.Sheets("Data")
With dailyrecapwb.Sheets(1)
LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
LastCol = .Cells(7, .Columns.Count).End(xlToLeft).Column
destSheet.Cells(1).Resize(LastRow - 7 + 1, LastCol).Value = .Range(.Cells(7, 1), .Cells(LastRow, LastCol)).Value
End With
dailyrecapwb.Close
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I wanted to use copy and paste, since I have some Pivot tables based on this data, which I want to update automatically. I just assumed that this might cause problems, but tried it out now and it works perfectly.
THanks again!