LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Setting a formula with code in worksheet added

Hi!

I have a workbook that has three worksheets in it.
Recap (sheet 1), Payroll (sheet 2), and Details (sheet 3).

I also have an addin file that loads with this workbook and it contains all
the codes to operate the buttons and menus on the workbook.

In the addin file I have the same three worksheets (recap, payroll, and
details). These were put in the addin file...inorder to run code that
copies these worksheets and adds them to the activeworkbook incase the users
needs more of those sheets. If one sheet is added they all three added
.....as they work together.

So... after a one set of the worksheets have been added.. the workbook
contains the following sheets:
Recap, Payroll, Detail, Recap (2), Payroll (2), Details (2)

They can added as many sets as needed....my guess is it won't go over 20
sets..but you not 100% sure.

Anyway... Adding the sheets is working fine...... however.. I now have
formulas that are in the Recap sheet that link to the Details sheet and I
need to add the formula to the added recap sheets...when it is added and
have it correspond to the added Details sheet that works with it...

Is there a way to add a formula to the added Recap sheet that will reference
the added Details sheet .....keep in mind I won't know the number of the
sheets added...as the user can add as many sets as needed. They are added
is sets ... which I think helps with running the code to do this..

The formula needs to go into cell D8 of the Recap sheets added and is
=Details(with corresponding page #)!G7

Maybe.... there is a way to look at the Recap sheet number that has been
added ( for ex...Recap (2) ) and have code set cell D8 of the Recap (2) to
=Details (2)!G7 and so on... so when a thrid set of sheets are added... the
sheets would be Recap (3), Payroll (3), and Details (3)...and the formula
needed in Recap (3) cell D8 would need to be =Details (3)!G7

I hope this made sense....it was hard to explain.. :)

Any help would be greatly appreciated..
Thanks in advance..
Kimberly


 
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
automatically appending newly added data on worksheet to a master list worksheet tabylee via OfficeKB.com Links and Linking in Excel 0 December 17th 09 04:24 PM
setting excel formula from code Ralf Excel Discussion (Misc queries) 4 July 14th 09 10:31 PM
why is ...xls] being added to the name on my worksheet? beauwl Excel Worksheet Functions 2 October 3rd 07 05:00 PM
I forget the code added on my execl report Jane Excel Discussion (Misc queries) 2 September 26th 06 07:53 AM
Condition added to Sort Code Todd Huttenstine[_3_] Excel Programming 1 January 2nd 04 09:35 AM


All times are GMT +1. The time now is 05:27 AM.

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"