Couple of suggestions for what is almost surely a homework assignment. Did not test it or worry about the math (otherwise it wouldn't be a homework assignment)
1. There is a difference between a Function and as Sub. Simple example to just double a number that shows the difference. Look where and how the result is returned to the upper level function that called it
Option Explicit
Sub Button_Click()
Dim NumberIn As Long, Result As Long
NumberIn = InputBox("Enter Number", "Number")
Call Double_As_Sub(NumberIn, Result)
MsgBox "The result using a sub is " & Result
MsgBox "The result using a function is " & Double_As_Function(NumberIn)
End Sub
Sub Double_As_Sub(N As Long, R As Long)
R = 2 * N
End Sub
Function Double_As_Function(N As Long) As Long
Double_As_Function = 2 * N
End Function
2. Variables have a scope, i.e. which subs or functions an see them. You had some Dim-ed in the Click sub, and so were not available to the others. Good idea to avoid global variables, and to Dim them 'local' to the sub or function that actually uses them
3. There were calls to functions that are not VBA functions
4. Some variables were never Dim-ed and/or were not ever given a value
5. Here's some annotations to (I hope) help you along
Option Explicit
Private Sub CommandButton1_Click()
' Local Variables
Dim sin As Double
Dim val As Double ' Not range
'wrong call to InputBox
val = InputBox("Please Enter an Angle in Degrees", "Angle")
Call Sine(val, sin)
'no need to return result
Call MsgBox("The sine of angle " & val & " is " & sin, , "Sine")
End Sub
'val is double not range, this seems like it should be a Sub, not Function
Public Sub Sine(val As Double, sin As Double)
'these were out of scope (= invisible) to this function since they were 'local' to the sub above
Dim Series As Integer
Dim Add As Boolean
Dim blnAddTerm As Boolean
'you use this but never Dim or set it
Dim DegInRads As Double
DegInRads = 360# / 6.28318530717958
Add = False
Do While True
Series = Series + 1
If Series Mod 2 <> 0 And Series > 1 Then
If Add Then
sin = sin + (val ^ Series) / dev(CLng(Series))
blnAddTerm = False
Else
sin = sin - (val ^ Series) / dev(CLng(Series)) ' intSeries should probably be 'Series'
blnAddTerm = True
End If
End If
'Factorial is not an intrinsic VBA function. To use the worksheet formula version ...
If (DegInRads ^ Series) / Application.WorksheetFunction.Fact(CLng(Series)) < 0.0000000001 Then Exit Do
Loop
'no idea, since SinBySeries is not defined
'SinBySeries = sin
'but since this is a sub, the value of 'sin' is returned in the calling parameter
End Sub
Private Function dev(intNumber As Long) As Long
Dim i As Long
For i = intNumber To 0 Step -1
dev = dev + I
Next i
End Function