Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default adding to a formula

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default adding to a formula

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default adding to a formula

No. You are mixing VBA with Worksheet formulas.

--
Regards,
Tom Ogilvy


"Scott" wrote in message
...
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
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
Adding formula Scoober Excel Worksheet Functions 1 February 18th 10 03:32 AM
Adding on to a formula Joe Gieder Excel Worksheet Functions 2 November 22nd 06 09:53 PM
adding a formula including the value another formula gets Dana Excel Discussion (Misc queries) 7 March 22nd 06 04:00 PM
Formula help : adding Niki New Users to Excel 3 March 24th 05 06:43 AM
Adding another formula to and Exsiting Formula craigwojo[_4_] Excel Programming 0 February 16th 05 06:20 PM


All times are GMT +1. The time now is 12:05 PM.

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

About Us

"It's about Microsoft Excel"