Hi All,
Previously I had a little help online including in this forum on finding how to write a macro to move data from one workbook to another,
This time its the same idea but from one worksheet to another 2 worksheet based on a True or false.
From Raw Data file: I want to move all with True in Column AN to worksheet Reported1 and True from column AO to worksheet Disabled!
Sub Data2Sheets()
Dim wb As Workbook, wbRaw As Workbook
Dim ws As Worksheet, wsRaw As Worksheet
Dim rg As Range, lRow As Long
Set wb = ThisWorkbook 'Workbook data is copied to
Set wbRaw = Workbooks("P-C Report Template.xlsm")
Set wsRaw = wbRaw.Worksheets("Raw")
Set rg = wsRaw.UsedRange
For Each ws In wb.Worksheets
wsRaw.Rows(1).Copy ws.Rows(1) 'Creates header row
lRow = ws.Cells(Rows.Count, 4).End(xlUp).Row
rg.AutoFilter 4, ws.Name
rg.Offset(1, 0).Copy ws.Cells(lRow + 1, 1)
Next ws
End Sub
Previously that was the code used but this time I am looking for something different and I tried tweaking that but does not help
Bookmarks