• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

when a new sheet adds , add that summarised row to the current sheet dynamically

madhavi

New Member
I have a sheet name summary in the workbook where i maintain the

summarised data of all the sheets in each row .

example students noofdownloads noofprints

week1 123 234

week2 345 254

when a new sheet is added to the workbook , the summary sheet should have another row

week3 345 354 (i mean total the things in week3 which is same formula used for othe rrow. this should happen without human intervention . How to do this .
 
[pre]
Private Sub Workbook_NewSheet(ByVal Sh As Object)
Sh.Name = "Week" & Me.Worksheets.Count - 1
With Me.Worksheets("Summary")

With .Range("A1").End(xlDown)

.EntireRow.Copy .Offset(1, 0)
.Offset(1, 0).Value = Sh.Name
End With
End With
End Sub[/pre]

'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
 
Back
Top