Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sum cells
How can I sum several cells and display the result in a textbox
-- Tdp |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sum cells
Hi,
Put your textbox from the Control toolbox on your worksheet, you then have choices. 1. While still in design mose right click the textbox and view code and paste this in Private Sub TextBox1_GotFocus() TextBox1.Text = WorksheetFunction.Sum(Range("A1:a10")) End Sub Exit design mode and when the textbox is selected the sum is displayed. or. 2. Exit desing mode and right click the sheet tab, view code and paste this in Private Sub Worksheet_Change(ByVal Target As Range) TextBox1.Text = WorksheetFunction.Sum(Range("A1:a10")) End Sub The text box now does the sum whenever the worksheet changes. Mike "Tdp" wrote: How can I sum several cells and display the result in a textbox -- Tdp |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sum cells
Thanks Mike,
Iv used your second example. -- Tdp "Mike H" wrote: Hi, Put your textbox from the Control toolbox on your worksheet, you then have choices. 1. While still in design mose right click the textbox and view code and paste this in Private Sub TextBox1_GotFocus() TextBox1.Text = WorksheetFunction.Sum(Range("A1:a10")) End Sub Exit design mode and when the textbox is selected the sum is displayed. or. 2. Exit desing mode and right click the sheet tab, view code and paste this in Private Sub Worksheet_Change(ByVal Target As Range) TextBox1.Text = WorksheetFunction.Sum(Range("A1:a10")) End Sub The text box now does the sum whenever the worksheet changes. Mike "Tdp" wrote: How can I sum several cells and display the result in a textbox -- Tdp |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sum cells
Link the textbox to a cell in which you have a SUM formula?
Gord Dibben MS Excel MVP On Sat, 13 Dec 2008 06:21:01 -0800, Tdp wrote: How can I sum several cells and display the result in a textbox |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel: match two cells in one sheet to two cells in another and return a third cells value | Excel Worksheet Functions | |||
Cells won't change font color or show hi-lighted cells in document | Excel Discussion (Misc queries) | |||
display a range of cells editible cells based on matching date | Excel Worksheet Functions | |||
Setting of input cells as blue font and formula cells as black fon | Excel Discussion (Misc queries) | |||
trying to create an (almost) circular formula between cells and data validated cells with lists | Excel Worksheet Functions |