Calculating the total a number of cells that varies

philfloyduk

Board Regular
Joined
Jan 6, 2011
Messages
82
Hi all.

I have a sheet and userform that deals with our parts orders. Each time a part is put on the order the rows (from row 5) are shifted dowards to make way for the next part. The user manages this all with a userform which they view and process the order from.

What I would like to happen is that the _initialize on the form calculates the total price on the sheet at that time and puts it in the tbTotal textbox. If it makes it simpler there can be a limit of row 30 as it's highly unlikely we would have that many entries without processing the order.

Any help offered will be much appreciated!

Many thanks

Phil
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I think a label would be more appropriate ... the user should not be allowed to overwrite or enter into the textbox, surely.

To find the sum of a range in VBA it's simple, like this:
mysum = Application.Sum(Range("F2:F30"))

Does that help?
 
Upvote 0
Hi Glenn.

Thank you for your help, that does the job. I have the textbox locked, I simply prefer the appearance of them over labels.

Phil
 
Upvote 0

Forum statistics

Threads
1,224,596
Messages
6,179,807
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top