PC Review


Reply
Thread Tools Rate Thread

Adding a formula to the same cell (H5) on every tab

 
 
John13
Guest
Posts: n/a
 
      3rd Sep 2007
I have an inventory spreadsheet with 125 tabs. The tabs are numbered
1 through 125. The are identical except for the data below the column
headings. If I wanted to put a formula in H5 on every tab, can it be
done other than manually opening every tab and typing it?

One additional question: If I add a Summary Tab, how could I show the
value of a specific cell on each tab without manually entering it? I
show the formula I'm using bring B3 to the summary for every tab:

A B
1 Unit Value
2 1 ='1'!B3
3 2 ='2'!B3
4 3 ='3'!B3
5 4 ='4'!B3
6 5 ='5'!B3
7 6 ='6'!B3
8 7 ='7'!B3
9 8 ='8'!B3
But to do it 125 times is a killer, besides I want to bring other
specific cells over to the summary also. I was thinking of
CONCATENATE if all else fails. Help please! Thanking you ahead of
time.

John

 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      3rd Sep 2007
>I have an inventory spreadsheet with 125 tabs. The tabs are numbered
> 1 through 125. The are identical except for the data below the column
> headings. If I wanted to put a formula in H5 on every tab, can it be
> done other than manually opening every tab and typing it?


Assuming the formula is the same for each sheet, add this macro (to any
sheet's code window will do)...

Sub AddFormulaToH5()
Dim WS As Worksheet
For Each WS In Worksheets
WS.Range("H5").Formula = "=TEXT(NOW(),""mmmm, dddd"")"
Next
End Sub

You didn't tell us what your formula was, so I made one up for example
purposes. Now, go to the sheet where you placed the macro, press Alt+F8 and
run the macro. The formula should now be embedded in cell H5 of each sheet.
Delete the macro (it has done its job) and then do a save.

Rick

 
Reply With Quote
 
Earl Kiosterud
Guest
Posts: n/a
 
      3rd Sep 2007
John,

You can put the formula in all the H5 cells by hand if the sheets are contiguous. Select
them all (Click the left-most, then scroll to the right-most and Shift-click it). If there
are sheets among them that should not be included, you can deselect them by Ctrl-clicking.
Select H5, type in your formula, and press Enter. That's it! Bob's your uncle. Be sure to
unselect the sheets before you continue -- anything you do with them selected happens to
all of them. Many filthy words have been uttered when people untentionally overwrote stuff
into multiple-selected sheets.

As for the summary, that's a big order with 125 sheets. Let me toss this in. Often, people
put stuff in separate sheets when putting them in one sheet would make life much easier, and
provide much more functionality (such as your summarizing). There's not much of a
down-side. Take a look at "Data across multiple sheets" at
http://www.smokeylake.com/excel/excel_truths.htm.
--
Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"John13" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have an inventory spreadsheet with 125 tabs. The tabs are numbered
> 1 through 125. The are identical except for the data below the column
> headings. If I wanted to put a formula in H5 on every tab, can it be
> done other than manually opening every tab and typing it?
>
> One additional question: If I add a Summary Tab, how could I show the
> value of a specific cell on each tab without manually entering it? I
> show the formula I'm using bring B3 to the summary for every tab:
>
> A B
> 1 Unit Value
> 2 1 ='1'!B3
> 3 2 ='2'!B3
> 4 3 ='3'!B3
> 5 4 ='4'!B3
> 6 5 ='5'!B3
> 7 6 ='6'!B3
> 8 7 ='7'!B3
> 9 8 ='8'!B3
> But to do it 125 times is a killer, besides I want to bring other
> specific cells over to the summary also. I was thinking of
> CONCATENATE if all else fails. Help please! Thanking you ahead of
> time.
>
> John
>



 
Reply With Quote
 
Sandy Mann
Guest
Posts: n/a
 
      3rd Sep 2007
For the 125 formulas this works for me:

Option Explicit
Sub FillIt()
Dim x As Integer
Dim sTotal As Integer
Dim WS As Integer
Dim Nom As String
Dim cell As String
Dim cFormula As String

x = 2
sTotal = Worksheets.Count
For WS = 1 To sTotal - 1
Nom = Worksheets(WS).Name
cell = Cells(3, 2).Address
cFormula = "'" & Nom & "'!" & cell
Cells(x, 2).Formula = "=" & cFormula
x = x + 1
Next WS
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(E-Mail Removed)
Replace @mailinator.com with @tiscali.co.uk


"John13" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have an inventory spreadsheet with 125 tabs. The tabs are numbered
> 1 through 125. The are identical except for the data below the column
> headings. If I wanted to put a formula in H5 on every tab, can it be
> done other than manually opening every tab and typing it?
>
> One additional question: If I add a Summary Tab, how could I show the
> value of a specific cell on each tab without manually entering it? I
> show the formula I'm using bring B3 to the summary for every tab:
>
> A B
> 1 Unit Value
> 2 1 ='1'!B3
> 3 2 ='2'!B3
> 4 3 ='3'!B3
> 5 4 ='4'!B3
> 6 5 ='5'!B3
> 7 6 ='6'!B3
> 8 7 ='7'!B3
> 9 8 ='8'!B3
> But to do it 125 times is a killer, besides I want to bring other
> specific cells over to the summary also. I was thinking of
> CONCATENATE if all else fails. Help please! Thanking you ahead of
> time.
>
> John
>
>



 
Reply With Quote
 
Ragdyer
Guest
Posts: n/a
 
      3rd Sep 2007
To answer the second part of your question, one way is to simply create your
number list down a column, from 1 to 125, just as in your example, say from
A2 to A126.

Enter this formula in B2:

=INDIRECT(A2&"!B3")

And drag down to copy as needed.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"John13" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have an inventory spreadsheet with 125 tabs. The tabs are numbered
> 1 through 125. The are identical except for the data below the column
> headings. If I wanted to put a formula in H5 on every tab, can it be
> done other than manually opening every tab and typing it?
>
> One additional question: If I add a Summary Tab, how could I show the
> value of a specific cell on each tab without manually entering it? I
> show the formula I'm using bring B3 to the summary for every tab:
>
> A B
> 1 Unit Value
> 2 1 ='1'!B3
> 3 2 ='2'!B3
> 4 3 ='3'!B3
> 5 4 ='4'!B3
> 6 5 ='5'!B3
> 7 6 ='6'!B3
> 8 7 ='7'!B3
> 9 8 ='8'!B3
> But to do it 125 times is a killer, besides I want to bring other
> specific cells over to the summary also. I was thinking of
> CONCATENATE if all else fails. Help please! Thanking you ahead of
> time.
>
> John
>


 
Reply With Quote
 
John13
Guest
Posts: n/a
 
      4th Sep 2007
On Sep 3, 4:41 pm, "Ragdyer" <RagD...@cutoutmsn.com> wrote:
> To answer the second part of your question, one way is to simply create your
> number list down a column, from 1 to 125, just as in your example, say from
> A2 to A126.
>
> Enter this formula in B2:
>
> =INDIRECT(A2&"!B3")
>
> And drag down to copy as needed.
> --
> HTH,
>
> RD
>
> ---------------------------------------------------------------------------
> Please keep all correspondence within the NewsGroup, so all may benefit !
> ---------------------------------------------------------------------------"John13" <johnasmit...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > I have an inventory spreadsheet with 125 tabs. The tabs are numbered
> > 1 through 125. The are identical except for the data below the column
> > headings. If I wanted to put a formula in H5 on every tab, can it be
> > done other than manually opening every tab and typing it?

>
> > One additional question: If I add a Summary Tab, how could I show the
> > value of a specific cell on each tab without manually entering it? I
> > show the formula I'm using bring B3 to the summary for every tab:

>
> > A B
> > 1 Unit Value
> > 2 1 ='1'!B3
> > 3 2 ='2'!B3
> > 4 3 ='3'!B3
> > 5 4 ='4'!B3
> > 6 5 ='5'!B3
> > 7 6 ='6'!B3
> > 8 7 ='7'!B3
> > 9 8 ='8'!B3
> > But to do it 125 times is a killer, besides I want to bring other
> > specific cells over to the summary also. I was thinking of
> > CONCATENATE if all else fails. Help please! Thanking you ahead of
> > time.

>
> > John- Hide quoted text -

>
> - Show quoted text -


Thank you all very much. I love learning Excel. I tried them all and
fixed my problem. Thank you for your time.

John

 
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 formula to cell jodleren Microsoft Excel Programming 2 8th Oct 2008 12:08 PM
adding a formula around a cell reference =?Utf-8?B?R3JlZWs3Nw==?= Microsoft Excel Misc 4 17th May 2007 10:32 PM
ADDING A FORMULA TO A CELL =?Utf-8?B?Z2VldmVzMTI5Mw==?= Microsoft Access Getting Started 5 25th Jul 2006 03:33 PM
Adding formula to a cell with VB Willow Microsoft Excel Programming 4 25th Jul 2006 12:28 PM
adding a formula in a cell but when cell = 0 cell is blank =?Utf-8?B?TWlrZSBU?= Microsoft Excel Worksheet Functions 5 31st May 2005 01:08 AM


Features
 

Advertising
 

Newsgroups
 


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