Automating a line item for several worksheets?

G

Guest

I want to automate a row with summary calculations for each worksheet that is
added to my workbook. Is there a macro that would enable me to add a row with
calculations for a series of worksheets? The worksheets will use the same
format, so that the data will be easily found. I intend to control where the
new worksheets are placed by ensuring they are placed between two hidden
worksheets.

Thanks.
 
V

Vasant Nanavati

I'm not sure I clearly understand the requirements, but try putting code
like this in the ThisWorkbook code module:

Private Sub Workbook_NewSheet(ByVal Sh As Object)
Sh.Range("A30:G30").FormulaR1C1 = "=SUM(R2C:R[-1]C)"
End Sub

Adjust the formula(s) to suit.
___________________________________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top