Excel workbook, same name on diff sheets, need the next column and
hi i have a workbook. which has different days of the week as sheets, in the
sheets is names eg Player Points Abbey 2 Bethany 6 Carol 9 but on other days theres more or less names. on my main sheet i have a list of names. but would like to have this list automatically added to if there is a new player on a day. instead of adding automatically. back to the problem i have i want to add up each players totals and display them on the main page. please can anyone help me thank you for any help you give |
Excel workbook, same name on diff sheets, need the next column and
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Const WS_RANGE As String = "A:A" '<== change to suit On Error GoTo ws_exit Application.EnableEvents = False If Sh.Name < "Master" Then If Not Intersect(Target, Sh.Range(WS_RANGE)) Is Nothing Then With Target If Application.CountIf(Range("Master!A:A"), Target.Value) = 0 Then Worksheets("Master").Range("A1").End(xlDown).Offse t(1, 0).Value = Target.Value End If End With End If End If ws_exit: Application.EnableEvents = True End Sub -- __________________________________ HTH Bob "ycwkpp898" wrote in message ... hi i have a workbook. which has different days of the week as sheets, in the sheets is names eg Player Points Abbey 2 Bethany 6 Carol 9 but on other days theres more or less names. on my main sheet i have a list of names. but would like to have this list automatically added to if there is a new player on a day. instead of adding automatically. back to the problem i have i want to add up each players totals and display them on the main page. please can anyone help me thank you for any help you give |
Excel workbook, same name on diff sheets, need the next column
hi bob and thank you.
i have done that. i dont know how to display the info in the next column next to the name. sorry i am very new to visual basic and formulas "Bob Phillips" wrote: 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Const WS_RANGE As String = "A:A" '<== change to suit On Error GoTo ws_exit Application.EnableEvents = False If Sh.Name < "Master" Then If Not Intersect(Target, Sh.Range(WS_RANGE)) Is Nothing Then With Target If Application.CountIf(Range("Master!A:A"), Target.Value) = 0 Then Worksheets("Master").Range("A1").End(xlDown).Offse t(1, 0).Value = Target.Value End If End With End If End If ws_exit: Application.EnableEvents = True End Sub -- __________________________________ HTH Bob "ycwkpp898" wrote in message ... hi i have a workbook. which has different days of the week as sheets, in the sheets is names eg Player Points Abbey 2 Bethany 6 Carol 9 but on other days theres more or less names. on my main sheet i have a list of names. but would like to have this list automatically added to if there is a new player on a day. instead of adding automatically. back to the problem i have i want to add up each players totals and display them on the main page. please can anyone help me thank you for any help you give |
All times are GMT +1. The time now is 09:22 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com