Functions in VBA

GabyB

New Member
Joined
Mar 19, 2016
Messages
6
Hi I was wondering can anyone help me with this problem, I need a way to calculate the max, min, average, median, mode, amount of numbers, amount of positive numbers, amount of negative numbers, amount of numbers that are equal to cero, the sum of all the positive numbers, the sum of all negative numbers, and the sum of all numbers, the problem is that The colum where all the data can be found changes and doesn't have an specific range it just all the numbers found in Column C, also the data is on Worksheet "Table" and the max, min, average etc. must be display of worksheet "Summary" can anyone help me please? it's urgent!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Have you done any research at all, other than posting here. All the functions you need are very basic and there is a plethora of information on the net.

If it is "urgent", perhaps you should take matters into your own hands.

igold
 
Upvote 0
Hi I did my research and found and it was helpful but do you think you can help me with the Sum of positive and negative numbers I wrote this but it doesn't work...
Sub PositiveSum()

Dim rng As Range
Dim dblSum As Double

Set rng = Hoja2.Range("C2:C100")

If rng > 0 Then
dblSum = Application.WorksheetFunction.Sum(rng)
End If

Worksheets("Resumen").Cells(11, 2).Value = dblSum

End Sub
 
Upvote 0
Have you looked at the SUM, COUNT, or COUNTIF functions?
There are also AVERAGE, MODE and MEDIAN functions, as well as AVERAGEIF.
 
Upvote 0
There is no diference my computer rebooted and thought the post hadn't submit the first time, I hadn't notice thanks!
 
Upvote 0
There is no diference my computer rebooted and thought the post hadn't submit the first time, I hadn't notice thanks!


Might be of some use subscribing to your threads, at least in that case you will get notified if someone responds to one of your posts (see the link below for info about subscriptions).

Also if you click your username near the top of the page (next to welcome,) you will get a list of what you have posted.

Hope that helps

Setting and Profile Features
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,947
Members
449,480
Latest member
yesitisasport

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