PC Review


Reply
Thread Tools Rate Thread

adding to a formula

 
 
=?Utf-8?B?U2NvdHQ=?=
Guest
Posts: n/a
 
      4th Oct 2006
I have a workbook with 2 worksheets. Each cell (10 rows by 25 columns worth)
in the last worksheet adds the value from the corresponding cell in the first
worksheet to a constant number (e.g. sheetlast.cell(A1) = sheet1.cell(A1)+5).
I have created a maco to make a copy of the first worksheet for a total of
3 worksheets. I want to add to the macro to update the formulas in the last
worksheet to look something like this
sheetlast.cell(A1) = sheet1.cell(A1)+sheet2.cell(A1) + 5.
Anyone ideas how to do?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      4th Oct 2006
why not make five sheets
adding a sheet named first and a sheet named last (leave these blank).

then put the sheets to be summed between the first and last sheets in the
tab order. So the tabs would look like
First
Sheet1
Sheet2
Last
Summary

then in A1 of the summary sheet put
=Sum(First:Last!A1)+5

then drag fill down 10 and across 15

Now whenever you add a sheet, put it somewhere between first and last and it
will be included in the sum.

--
Rgards,
Tom Ogilvy


"Scott" wrote:

> I have a workbook with 2 worksheets. Each cell (10 rows by 25 columns worth)
> in the last worksheet adds the value from the corresponding cell in the first
> worksheet to a constant number (e.g. sheetlast.cell(A1) = sheet1.cell(A1)+5).
> I have created a maco to make a copy of the first worksheet for a total of
> 3 worksheets. I want to add to the macro to update the formulas in the last
> worksheet to look something like this
> sheetlast.cell(A1) = sheet1.cell(A1)+sheet2.cell(A1) + 5.
> Anyone ideas how to do?

 
Reply With Quote
 
=?Utf-8?B?U2NvdHQ=?=
Guest
Posts: n/a
 
      5th Oct 2006
Thanks Tom. Could I use this Sheets(Sheets.Count).Name To determine the
last sheet name? Would it then look like

=Sum(First:Sheets(Sheets.Count).Name!A1)+5

----------------------------------------------------------------------------------------
"Tom Ogilvy" wrote:

> why not make five sheets
> adding a sheet named first and a sheet named last (leave these blank).
>
> then put the sheets to be summed between the first and last sheets in the
> tab order. So the tabs would look like
> First
> Sheet1
> Sheet2
> Last
> Summary
>
> then in A1 of the summary sheet put
> =Sum(First:Last!A1)+5
>
> then drag fill down 10 and across 15
>
> Now whenever you add a sheet, put it somewhere between first and last and it
> will be included in the sum.
>
> --
> Rgards,
> Tom Ogilvy
>
>
> "Scott" wrote:
>
> > I have a workbook with 2 worksheets. Each cell (10 rows by 25 columns worth)
> > in the last worksheet adds the value from the corresponding cell in the first
> > worksheet to a constant number (e.g. sheetlast.cell(A1) = sheet1.cell(A1)+5).
> > I have created a maco to make a copy of the first worksheet for a total of
> > 3 worksheets. I want to add to the macro to update the formulas in the last
> > worksheet to look something like this
> > sheetlast.cell(A1) = sheet1.cell(A1)+sheet2.cell(A1) + 5.
> > Anyone ideas how to do?

 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      6th Oct 2006
No. You are mixing VBA with Worksheet formulas.

--
Regards,
Tom Ogilvy


"Scott" <(E-Mail Removed)> wrote in message
news:95BE91EF-002E-4CA4-BF36-(E-Mail Removed)...
> Thanks Tom. Could I use this Sheets(Sheets.Count).Name To determine
> the
> last sheet name? Would it then look like
>
> =Sum(First:Sheets(Sheets.Count).Name!A1)+5
>
> ----------------------------------------------------------------------------------------
> "Tom Ogilvy" wrote:
>
>> why not make five sheets
>> adding a sheet named first and a sheet named last (leave these blank).
>>
>> then put the sheets to be summed between the first and last sheets in the
>> tab order. So the tabs would look like
>> First
>> Sheet1
>> Sheet2
>> Last
>> Summary
>>
>> then in A1 of the summary sheet put
>> =Sum(First:Last!A1)+5
>>
>> then drag fill down 10 and across 15
>>
>> Now whenever you add a sheet, put it somewhere between first and last and
>> it
>> will be included in the sum.
>>
>> --
>> Rgards,
>> Tom Ogilvy
>>
>>
>> "Scott" wrote:
>>
>> > I have a workbook with 2 worksheets. Each cell (10 rows by 25 columns
>> > worth)
>> > in the last worksheet adds the value from the corresponding cell in the
>> > first
>> > worksheet to a constant number (e.g. sheetlast.cell(A1) =
>> > sheet1.cell(A1)+5).
>> > I have created a maco to make a copy of the first worksheet for a
>> > total of
>> > 3 worksheets. I want to add to the macro to update the formulas in the
>> > last
>> > worksheet to look something like this
>> > sheetlast.cell(A1) = sheet1.cell(A1)+sheet2.cell(A1) + 5.
>> > Anyone ideas how to do?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a formula or entering a formula? tigerlileigh Microsoft Dot NET 0 11th Jul 2008 06:00 AM
Adding to a formula Jooles Microsoft Excel Misc 4 13th Mar 2008 11:33 PM
adding a formula including the value another formula gets Dana Microsoft Excel Misc 7 22nd Mar 2006 04:00 PM
Adding another formula to and Exsiting Formula craigwojo Microsoft Excel Programming 0 16th Feb 2005 06:20 PM
help adding to my formula Microsoft Excel Worksheet Functions 5 4th Aug 2004 07:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:24 AM.