1. ## VBA Exponential Smoothing

I'm trying to create a function for implementing simple exponential smoothing in this VBA spreadsheet.
I've gotten code I've amended from online to suit my needs but it's running incorrectly, it only pastes 0's in column C.

```Sub ExpSmoothing()
Dim y As Double
Dim Lastyhat As Double
Dim Currentyhat As Double
Dim i As Integer
Dim alpha As Variant

alpha = Application.InputBox("What is your alpha value?")

If alpha > 0 And alpha < 1 And IsNumeric(alpha) Then
With Worksheets("Data")
.Range("C1").Value = "Exp Smoothing"

For i = 1 To 15

.Range(.Cells(i + 1, 3), .Cells(14, 3)).Value = y

.Range("C2" & i).Value = Lastyhat

Currentyhat = Lastyhat + (alpha * (y - Lastyhat))

Lastyhat = Currentyhat

.Range("C" & i + 1).Value = Currentyhat

Next i
End With
Else
MsgBox ("Please choose an alpha that is numeric and between 0 and 1")
End If
End Sub```

2. Can you post a workbook with sample data?

3. Variable y seems to be discarded.

4. All the math in your loop always results in zeros

5. At least that seems very smooth indeed.

6. oo0000o0o0oo000

7. ## HEY BUddy I'm also facing similar problem, if got the solution for this can you pleas

HEY BUddy I'm also facing similar problem, if got the solution for this can you please guide me
thank you

8. @paulkpk. Where does one start? Same problem as SamT "ooOOOOoOoOooOOO" or "All the math in your loop will end in Zeros", or snb who thinks "Variable Y seems to be discarded" or "it seems very smooth indeed", Paul_Hossler who is wanting a sample book to be provided, or the OP of this old thread?

It always amazes me that people jump unto old threads, provided very little in way of supporting information, and demand that someone replies as soon a possible. I'm assuming you have at least read this thread before posting, and from that you can reasonably see that no solution was found since those wanting to assist were waiting for the OP to supply further detail. Which brings me to the second point, since there is clearly very little supporting data why would you not provide a workbook sample to allow others to assist you. Thirdly, it would be extremely helpful if you could indicate what your own efforts so far have achieved.

9. @AussieB

I fully agree.
But I fear that, considering paulpk's national flag, it's 'pearls before swine'.