I have the following code, which works fine when selecting ALL the columns A:F
How can I change this so that it only selects Columns A and F and copies the values to the destination range?
Private Sub CommandButton1_Click()
'collate data from all daily sheets onto Week sheet
Dim firstRow As Double, lastRow As Double, srcRng As Range, destRng As Range, ws As Worksheet
firstRow = 6
For Each ws In Sheets
'goes through the workbook grabbing data, if the sheet isn't called "Graphs" or "Week"
With ws
If (.Name) <> "Graphs" And (.Name) <> "Week" Then
'finds last used row by selecting last row and simulating ctrl-up arrow
lastRow = .Cells(Rows.Count, "A").End(xlUp).Row
If lastRow >= firstRow Then 'makes sure there's some data to copy
'gets range of data in current sheet
Set srcRng = .Range(.Cells(firstRow, "A"), .Cells(lastRow, "F"))
'gets range of first cell on row below data already on sheet
Set destRng = Sheets("Week").Cells(Rows.Count, "B").End(xlUp).Resize(lastRow - firstRow + 1, 6).Offset(1, -1)
destRng.Value = srcRng.Value
End If
End If
End With
Next ws
Bookmarks