ziad alsayed
Well-known Member
- Joined
- Jul 17, 2010
- Messages
- 665
dear all
the below code is working perfectly, i just need to reduce it.
appreciate any help
the below code is working perfectly, i just need to reduce it.
appreciate any help
Code:
Sub MoveSalesToSheets()
Dim wbo As Workbook
Set wbo = ActiveWorkbook
Set wsd = wbo.Worksheets("Data")
Set wsphc = wbo.Worksheets("PHC")
Set wsapapa = wbo.Worksheets("Apapa")
Set wsvi = wbo.Worksheets("VI")
Set wskano = wbo.Worksheets("Kano")
Set wsikeja = wbo.Worksheets("Ikeja")
wsphc.Select
If Cells(2, 1) = "Jan" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(4, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(4, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(4, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(4, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(4, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(4, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
Range(Cells(4, 2), Cells(15, 2)).Select
With Selection
.Value = .Value
End With
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(4, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(4, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(4, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(4, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(4, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(4, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(4, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(4, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(4, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(4, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(4, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(4, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(4, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(4, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(4, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(4, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(4, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(4, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(4, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(4, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(4, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(4, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
'wsphc.Select
ElseIf Cells(2, 1) = "Feb" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(5, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(5, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(5, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(5, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(5, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(5, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(5, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(5, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(5, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(5, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(5, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(5, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(5, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(5, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(5, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(5, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(5, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(5, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(5, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(5, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(5, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(5, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(5, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(5, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(5, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(5, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(5, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(5, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Mar" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(6, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(6, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(6, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(6, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(6, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(6, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(6, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(6, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(6, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(6, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(6, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(6, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(6, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(6, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(6, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(6, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(6, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(6, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(6, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(6, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(6, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(6, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(6, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(6, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(6, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(6, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(6, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(6, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Apr" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(7, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(7, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(7, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(7, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(7, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(7, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(7, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(7, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(7, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(7, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(7, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(7, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(7, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(7, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(7, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(7, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(7, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(7, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(7, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(7, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(7, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(7, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(7, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(7, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(7, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(7, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(7, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(7, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "May" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(8, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(8, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(8, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(8, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(8, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(8, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(8, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(8, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(8, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(8, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(8, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(8, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(8, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(8, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(8, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(8, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(8, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(8, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(8, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(8, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(8, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(8, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(8, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(8, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(8, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(8, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(8, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(8, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Jun" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(9, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(9, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(9, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(9, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(9, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(9, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(9, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(9, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(9, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(9, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(9, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(9, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(9, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(9, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(9, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(9, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(9, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(9, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(9, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(9, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(9, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(9, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(9, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(9, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(9, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(9, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(9, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(9, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Jul" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(10, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(10, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(10, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(10, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(10, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(10, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(10, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(10, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(10, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(10, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(10, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(10, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(10, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(10, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(10, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(10, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(10, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(10, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(10, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(10, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(10, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(10, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(10, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(10, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(10, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(10, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(10, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(10, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Aug" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(11, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(11, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(11, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(11, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(11, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(11, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(11, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(11, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(11, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(11, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(11, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(11, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(11, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(11, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(11, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(11, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(11, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(11, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(11, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(11, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(11, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(11, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(11, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(11, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(11, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(11, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(11, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(11, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Sep" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(12, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(12, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(12, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(12, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(12, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(12, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(12, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(12, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(12, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(12, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(12, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(12, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(12, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(12, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(12, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(12, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(12, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(12, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(12, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(12, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(12, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(12, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(12, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(12, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(12, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(12, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(12, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(12, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Oct" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(13, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(13, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(13, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(13, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(13, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(13, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(13, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(13, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(13, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(13, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(13, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(13, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(13, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(13, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(13, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(13, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(13, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(13, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(13, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(13, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(13, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(13, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(13, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(13, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(13, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(13, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(13, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(13, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Nov" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(14, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(14, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(14, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(14, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(14, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(14, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(14, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(14, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(14, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(14, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(14, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(14, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(14, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(14, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(14, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(14, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(14, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(14, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(14, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(14, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(14, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(14, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(14, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(14, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(14, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(14, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(14, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(14, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
ElseIf Cells(2, 1) = "Dec" Then
'Add Data to PHC Sheet
' select PHC Sheet
wsphc.Select
' sheet PHC, Solomon sales
Cells(15, 2).FormulaR1C1 = "=SUMIF(Data!C,PHC!R2C2,Data!C[1])"
' sheet PHC, Emeka sales
Cells(15, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],PHC!R2C5,Data!C[-2])"
' sheet PHC, Innocent sales
Cells(15, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],PHC!R2C8,Data!C[-5])"
' sheet PHC, Doris sales
Cells(15, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],PHC!R2C11,Data!C[-8])"
' sheet PHC, Spencer sales
Cells(15, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],PHC!R2C14,Data!C[-11])"
'sheet PHC Johnnie sales
Cells(15, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],PHC!R2C17,Data!C[-14])"
'add data to Apapa sheet
wsapapa.Select
'sheet Apapa Blessing sales
Cells(15, 2).FormulaR1C1 = "=SUMIF(Data!C,Apapa!R2C2,Data!C[1])"
' sheet Apapa Angela Sales
Cells(15, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Apapa!R2C5,Data!C[-2])"
'sheet Apapa Helen Sales
Cells(15, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Apapa!R2C8,Data!C[-5])"
'sheet Apapa Patrick Sales
Cells(15, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Apapa!R2C11,Data!C[-8])"
'sheet apapa Wesley Sales
Cells(15, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Apapa!R2C14,Data!C[-11])"
' sheet Apapa Linda Sales
Cells(15, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Apapa!R2C17,Data!C[-14])"
'add data to VI sheet
wsvi.Select
'sheet VI haytham sales
Cells(15, 2).FormulaR1C1 = "=SUMIF(Data!C,VI!R2C2,Data!C[1])"
' sheet VI Osaratin Sales
Cells(15, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],VI!R2C5,Data!C[-2])"
'sheet VI Romoke Sales
Cells(15, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],VI!R2C8,Data!C[-5])"
'sheet VI Dorothy Sales
Cells(15, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],VI!R2C11,Data!C[-8])"
'sheet VI Jhon Sales
Cells(15, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],VI!R2C14,Data!C[-11])"
'add data to Kano Sheet
wskano.Select
'sheet Kano Abdulkadir sales
Cells(15, 2).FormulaR1C1 = "=SUMIF(Data!C,Kano!R2C2,Data!C[1])"
' sheet Kano Sani Nasiru Sales
Cells(15, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Kano!R2C5,Data!C[-2])"
'sheet Kano Sani Adamu Sales
Cells(15, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Kano!R2C8,Data!C[-5])"
'sheet Kano Zahra Sales
Cells(15, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Kano!R2C11,Data!C[-8])"
' add Data to Ikeja Sheet
wsikeja.Select
' sheet Ikeja, Jide sales
Cells(15, 2).FormulaR1C1 = "=SUMIF(Data!C,Ikeja!R2C2,Data!C[1])"
' sheet Ikeja, Margaret sales
Cells(15, 5).FormulaR1C1 = "=SUMIF(Data!C[-3],Ikeja!R2C5,Data!C[-2])"
' sheet Ikeja, Folake sales
Cells(15, 8).FormulaR1C1 = "=SUMIF(Data!C[-6],Ikeja!R2C8,Data!C[-5])"
' sheet Ikeja, Sabitu sales
Cells(15, 11).FormulaR1C1 = "=SUMIF(Data!C[-9],Ikeja!R2C11,Data!C[-8])"
' sheet Ikeja, Olawaseum sales
Cells(15, 14).FormulaR1C1 = "=SUMIF(Data!C[-12],Ikeja!R2C14,Data!C[-11])"
'sheet Ikeja, Mohammed Khobaiz sales
Cells(15, 17).FormulaR1C1 = "=SUMIF(Data!C[-15],Ikeja!R2C17,Data!C[-14])"
'sheet Ikeja Patrick Sales
Cells(15, 20).FormulaR1C1 = "=SUMIF(Data!C[-18],Ikeja!R2C20,Data!C[-17])"
End If
End Sub