Techgirl
09-21-2011, 01:14 PM
I'm very new to vba and have no idea how to approach this problem. Would anybody like to help?
My goal is to modify this code (at the bottom) so that a user can designate a number larger than 1 and less than 101 through an input box to choose how many "scores" to calculate statistcs on. I have an excel sheet with cells a1 - a100 with random scores to calculate.
Dim msg As String
msg = "Here are summary measures for the scores:"
msg = msg & vbCrLf & "Average:" & vbTab & Application.WorksheetFunction.Average(Range("A1:A200"))
msg = msg & vbCrLf & "Stdev:" & vbTab & _
Format(Application.WorksheetFunction.StDev(Range("A1:A200")), "0.00")
msg = msg & vbCrLf & "Min:" & vbTab & Application.WorksheetFunction.Min(Range("A1:A200"))
msg = msg & vbCrLf & "Max:" & vbTab & Application.WorksheetFunction.Max(Range("A1:A200"))
MsgBox msg, vbInformation
hopefully I have provided enough information for anyone to follow me.. thanks for reading any help is appreciated :thumb
My goal is to modify this code (at the bottom) so that a user can designate a number larger than 1 and less than 101 through an input box to choose how many "scores" to calculate statistcs on. I have an excel sheet with cells a1 - a100 with random scores to calculate.
Dim msg As String
msg = "Here are summary measures for the scores:"
msg = msg & vbCrLf & "Average:" & vbTab & Application.WorksheetFunction.Average(Range("A1:A200"))
msg = msg & vbCrLf & "Stdev:" & vbTab & _
Format(Application.WorksheetFunction.StDev(Range("A1:A200")), "0.00")
msg = msg & vbCrLf & "Min:" & vbTab & Application.WorksheetFunction.Min(Range("A1:A200"))
msg = msg & vbCrLf & "Max:" & vbTab & Application.WorksheetFunction.Max(Range("A1:A200"))
MsgBox msg, vbInformation
hopefully I have provided enough information for anyone to follow me.. thanks for reading any help is appreciated :thumb