I
icestationzbra
julie,
here is the code that i am using:
Option Explicit
Sub test1()
Dim i As Long
Dim j As Long
Dim k As Long
Dim l As Long
Dim x As String
Dim started As Date, ended As Date
started = Timer
For i = 1 To 9999
j = Len(Trim(i))
l = 0
For k = 1 To j
l = l + Mid(i, k, 1) ^ 3
Next k
If i = l Then
x = x & ", " & i
End If
Next i
Sheet1.Range("a1").Value = x
ended = Timer
Sheet1.Range("a2").Value = Format(ended - started, "000.00000")
End Sub
*****
this is based out of a mathematical puzzle. take for example, th
number 153. cube every individual digit in it, and add them. the resul
is 153. so is 370, 371 and 407. i was trying to render this into
code.
thanks,
mac
here is the code that i am using:
Option Explicit
Sub test1()
Dim i As Long
Dim j As Long
Dim k As Long
Dim l As Long
Dim x As String
Dim started As Date, ended As Date
started = Timer
For i = 1 To 9999
j = Len(Trim(i))
l = 0
For k = 1 To j
l = l + Mid(i, k, 1) ^ 3
Next k
If i = l Then
x = x & ", " & i
End If
Next i
Sheet1.Range("a1").Value = x
ended = Timer
Sheet1.Range("a2").Value = Format(ended - started, "000.00000")
End Sub
*****
this is based out of a mathematical puzzle. take for example, th
number 153. cube every individual digit in it, and add them. the resul
is 153. so is 370, 371 and 407. i was trying to render this into
code.
thanks,
mac