View Single Post
12-02-2007, 05:49 PM
vbguru is offline vbguru
Status: I'm new around here
Join date: Dec 2007
Posts: 3
iTrader: 0 / 0%

vbguru is on a distinguished road


This is what I have for Question 2 - I feel it could be greatly improved though :/ - I still also have no way to check for all 4 digit numbers that do this.

[CODE]Option Explicit
'Written By Jack Morrison

Sub JMA3Q2()
Dim N0 As Integer
Dim N1 As Integer
Dim N2 As Integer
Dim Total As Integer
Dim Ftotal As Integer
Dim Success As Boolean

N0 = InputBox("Enter Your 4 Digit Number", "Magic Number Calculator")
N1 = InputBox("Enter the first 2 digits of the number", "Magic Number Calculator")
N2 = InputBox("Enter the second 2 digits of the number", "Magic Number Calculator")
Total = N1 + N2
Ftotal = Total ^ 2

(i think this is miner improvement than before )
If Ftotal = N0 Then
Success = True
MsgBox ("This number is a magic number: " & N0)
Success = False
MsgBox ("This Number is not a Magic Number: " & N0)
End If

End Sub

if i can send you my variation of this programme ?