Question : Sorting to Excel workbook to different sheets

I have a excel work book,  The First sheet is called Master, The other 12 sheets are january - December.  The First colum  'A"on Master is called site name , and second Column "b" is called Install date.  I need the names and install dates to show up on the respecetd months sheets.

Ex I have a 100 sites listed with various date  on January how do I get all the sites and install dates done in January to populate on the January sheet

Answer : Sorting to Excel workbook to different sheets

An alternative solution could be to have a macro something like this one to update the monthly sheets as the data is entered in the master sheet.

If you already have a lot of data to transfer you can use the loop (that's commented out)  to transfer all existing data. Replace ActiveCell.Row - 1 with i and remove ' before For and Next.

This code is in the sample file.

Regards,
Curt
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim i As Long, LastRow As Long, lRow As Long
    Dim Ws1 As Worksheet, Ws2 As Worksheet
    Dim iMonth As String
    If Not Intersect(Range("B:B"), Target) Is Nothing Then
        Set Ws1 = Worksheets("Master")
        LastRow = Ws1.Range("A65536").End(xlUp).Row
        'For i = 2 To LastRow
            iMonth = Format(Worksheets("Master").Cells(ActiveCell.Row - 1, 2), "mmm")
            On Error GoTo ErrorHandler
            Set Ws2 = Worksheets(iMonth)
            'find first empty row in month sheet
            lRow = Ws2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
            Ws2.Cells(lRow, 1) = Ws1.Cells(ActiveCell.Row - 1, 1)
            Ws2.Cells(lRow, 2) = Ws1.Cells(ActiveCell.Row - 1, 2)
        'Next i
    End If
    Exit Sub ' Avoid error handler
ErrorHandler:
   'Month sheet does not exist!
End Sub
Random Solutions  
 
programming4us programming4us