Code to create new wrksheet that totals the other wrksheets?

I have a file that contains x number of worksheets (the number ofworksheets may vary from month-to-month). All worksheets are set upthe same, though each contains different results. I'm trying to find away through VBA where a new worksheet is created (within the samefile) that totals certain lines from each of the worksheets (same rowsacross worksheets). Does anyone happen to have code for this? I cansend a sample file, if need be.

Share:

3 Answers Found

Yes. I've done this before. My free Excel add-in(www.grbps.com/adddin.htm) contains the facility to create new sheetsbased on a range which is selected. It then turns these sheet names intohyperlinks to open the new sheets. This is the code:

-------------------------------Sub MakeNewSheet()

Dim strMain As StringDim strAddress As StringDim BadCharsCount As IntegerDim DupeNameFlag As Boolean

Of course, this isn't quite what you want to do. You need to create onenew sheet, then in column A list the names of all sheets in the file andthen in the next column lift your number from that sheet. This code willdo it for you:

Yes. I've done this before. My free Excel add-in(www.grbps.com/adddin.htm) contains the facility to create new sheetsbased on a range which is selected. It then turns these sheet names intohyperlinks to open the new sheets. This is the code:

-------------------------------Sub MakeNewSheet()

Dim strMain As StringDim strAddress As StringDim BadCharsCount As IntegerDim DupeNameFlag As Boolean

Of course, this isn't quite what you want to do. You need to create onenew sheet, then in column A list the names of all sheets in the file andthen in the next column lift your number from that sheet. This code willdo it for you: