Forum Discussion
jenjers
Sep 02, 2022Copper Contributor
FILTER function across multiple sheets, display in separate sheet
I have 3 spreadsheets labeled 'lesson 1', 'lesson 2', and 'lesson 3'. I made a 4th spreadsheet labeled 'planner sheet'. In the first cell in the 'planner sheet' I put the formula: ={FILTER('les...
OliverScheurich
Sep 02, 2022Gold Contributor
Sub CurrentWeekData()
Dim WBK As Workbook
Dim WKS As Worksheet
Dim i As Long
Dim wn As Long
Dim j As Long
Dim k As Long
Dim m As Integer
Worksheets("planner sheet").Range("A2:Z1048576").Clear
k = 2
wn = Format(Date, "ww")
For Each WKS In ThisWorkbook.Worksheets
If WKS.Name <> "planner sheet" Then
i = WKS.Range("A" & Rows.Count).End(xlUp).Row
For j = 2 To i
If WKS.Cells(j, 1).Value = wn Then
For m = 1 To 26
Worksheets("planner sheet").Cells(k, m).Value = WKS.Cells(j, m).Value
Next m
k = k + 1
Else
End If
Next j
End If
Next WKS
End Sub
Maybe with these lines of code. In the attached file you can click the button in cell AB2 to run the macro.