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.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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
 
Upvote 0
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
 
Upvote 0
No big deal, but if someone else wanted to help it would be easier if they could see your origional questions and solution.
 
Upvote 0

Forum statistics

Threads
1,214,396
Messages
6,119,268
Members
448,881
Latest member
Faxgirl

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