Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting a formula in cell on a totals sheet using VB

Need Help,

I have a Totals sheet with several worksheets that represent projects. The
number of worksheets(projects) will be added or deleted depending on project
completions.

What I'm trying to do is have a Macro to run that will count the number of
worksheets (since the number is not constant) and force the formula -
+ 'sheetName" !B2 + 'sheetName' !B2 - into cell B2 on the Totals sheet.
Can anyone help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default setting a formula in cell on a totals sheet using VB

Try this

Add two dummy sheets(empty sheets)with the name start as the first sheet
and one with the name end as the last sheet of your workbook.
this are empty sheets!!!

All worksheets between these sheets will be sum
with this formula

=SUM(start:end!B2)


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"JAllen3023" wrote in message ...
Need Help,

I have a Totals sheet with several worksheets that represent projects. The
number of worksheets(projects) will be added or deleted depending on project
completions.

What I'm trying to do is have a Macro to run that will count the number of
worksheets (since the number is not constant) and force the formula -
+ 'sheetName" !B2 + 'sheetName' !B2 - into cell B2 on the Totals sheet.
Can anyone help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default setting a formula in cell on a totals sheet using VB

This file might be a help:
http://www.bygsoftware.com/examples/zipfiles/consol.zip
It's in the "Accountants" section on page:
http://www.bygsoftware.com/examples/examples.htm

The "Bread-Roll" consolidation method - great for accountants. See how
simple it is to consolidate any combination of your organisation's accounts.
(No VBA used)


--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"JAllen3023" wrote in message
...
Need Help,

I have a Totals sheet with several worksheets that represent projects. The
number of worksheets(projects) will be added or deleted depending on

project
completions.

What I'm trying to do is have a Macro to run that will count the number of
worksheets (since the number is not constant) and force the formula -
+ 'sheetName" !B2 + 'sheetName' !B2 - into cell B2 on the Totals sheet.
Can anyone help



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting a formula in cell on a totals sheet using VB

Hello,

Sub test()
somme = 0
For Each f In ActiveWorkbook.Worksheets
somme = somme + f.Cells(2, 2) ' B2
Next
MsgBox somme
End Sub

Good luck !

BG


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula setting cell type to blank and conditional formatting CEG_Staffer[_2_] Excel Worksheet Functions 6 July 17th 09 06:46 PM
Using a formula to carry totals from 1 sheet to another KGB003 Excel Discussion (Misc queries) 2 May 9th 09 06:23 PM
formula for totals throughout sheet Dottled Excel Discussion (Misc queries) 3 January 26th 09 03:53 PM
Setting a cell reference in one sheet that updates a workbook? Danhalawi Excel Discussion (Misc queries) 1 November 7th 06 04:08 PM
Setting Up A formula For A Time Sheet zooming Excel Worksheet Functions 4 June 27th 06 08:13 AM


All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"