View Single Post
 
Old 03-07-2016, 08:07 AM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,913
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

That is true but you don't really understand what return a result means. For your use the sub will work just fine. Functions usually perform calculations and then return a result.

For example if you recorded numberCorrect and numberWrong you could return the % age correct with a Function

Simple (trivial) example

Code:
Sub chexPercent()
Dim Correct As Long
Dim Wrong As Long
Correct = 3
Wrong = 4
MsgBox getpercent(Correct, Wrong) & "%"
End Sub

Function getpercent(numberCorrect As Long, numberWrong As Long) As Single
Dim totalTried As Long
totalTried = numberCorrect + numberWrong
getpercent = (numberCorrect / totalTried) * 100
End Function
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote