Using a Macro to sum the values in a Selected Range (Expand)

Mike E Golding

Board Regular
Joined
Mar 7, 2002
Messages
71
I have, for example,

Column A containing dates.
Column E containing Pay outs
Column D containing Pay Ins

I would like to be able to Select some of dates and to show a form
with the sum of the relevant Pay Outs in a TextBox on a UserForm and the sum of the relevant PayIns in another TextBox beneath the first and then to show a balance in a third TextBox.
The Userform is OK but now that I have been shown how to sum the values in a given range and it is workable I wonder if I can do the whole job with
just the relevant dates selected....Thanks for any thought..Mike.
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
You should just reply to your other message if you have a followup questions, and not make a new topic.

Try this.

Sub Test

x = Application.WorksheetFunction.Sum(Selection.Offset(0, 4))
MsgBox x

End Sub
 

Mike E Golding

Board Regular
Joined
Mar 7, 2002
Messages
71
Re: Using a Macro to sum the values in a Selected Range (Exp

My apologies, I am not very familiar with the system. I have been trying to use Hlookup but I seem to be missing the "mainxl.hlp file. Thanks again and hope I'm not a pain...Mike
 

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
No big deal, but if someone else wanted to help it would be easier if they could see your origional questions and solution.
 

Mike E Golding

Board Regular
Joined
Mar 7, 2002
Messages
71
Re: Using a Macro to sum the values in a Selected Range (Exp

Didn't think of that. Thanks again. Mike
 

Watch MrExcel Video

Forum statistics

Threads
1,127,263
Messages
5,623,700
Members
415,983
Latest member
MusicMan

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
Top