Macro to add cumulative total

  • Thread starter Thread starter Chance
  • Start date Start date
C

Chance

I have a button that copies and pastes the new sheet at
the end of the workbook. There is a cell lets say "H6"
that is a cumulative total of all sheets. Is there a way
to have a script added so it would take the total of the
active sheet("H5") plus the total of "H6" from the sheet
before it? The following is the script used to create the
new ticket.

Sub Button141_Click()
'
' Button141_Click Macro
' Macro recorded 1/24/2003 by CHANCE
'

'
Sheets(" Master").Copy Before:=Sheets("Employees")

' After:=Sheets(ActiveWorkbook.Worksheets.Count)
ActiveSheet.Range("AO3").Value = "Enter Date"
ActiveSheet.Range("K7").Value = "Enter Well Number"
MsgBox ("Please Change The DATE & WELL NUMBER. Thank
You & Stay Safe! Remember You Can ONLY Use - For Date
Entries")

Thanks,
Chance
 
Sub Button141_Click()
'
' Button141_Click Macro
' Macro recorded 1/24/2003 by CHANCE
'

'
Sheets(" Master").Copy Before:=Sheets("Employees")

' After:=Sheets(ActiveWorkbook.Worksheets.Count)
ActiveSheet.Range("AO3").Value = "Enter Date"
ActiveSheet.Range("K7").Value = "Enter Well Number"
Activesheet.Range("H6").Formula = "=H5+'" & Activesheet.Previous.Name _
& "'!H6"
MsgBox ("Please Change The DATE & WELL NUMBER. Thank
You & Stay Safe! Remember You Can ONLY Use - For Date
Entries")
 

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

Back
Top