Welcome to the forum! Please use code tags for code. Click the # icon and paste between tags.

It is not a good idea to use key words for you object or variable names that may collide with reserved key word commands and such. Do not mix variable types.

I added a value to B2 so delete or comment that line out. The results of Debug.Print will show in the Immediate window of the Visual Basic Editor (VBE).

Sub Calculatex()
  Dim Lengths() As Variant
  Dim a As Double
  Range("B2").Value = 4
  a = Range("B2").Value
  Lengths() = Ram(a)
  Debug.Print Lengths(1)
  Range("B21:D21").Value = Lengths()
End Sub


Function Ram(a As Double) As Variant
  Dim Tap() As Variant
  Dim b As Double
  Dim c As Double
  b = a + 1
  c = b + 1
  Tap() = Array(a, b, c)
  Ram = Tap()
End Function