Your SlideShare is downloading. ×
Programming
Programming
Programming
Programming
Programming
Programming
Programming
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Programming

2,297

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,297
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
164
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Calculator in EXCEL - VISUAL BASIC: Private Sub Command15_Click() num1 = Text1.TextDim op As String Text1.Text = ""Dim num1 As Integer op = "/"Dim num2 As Integer Command15.Visible = False Command21.Visible = TruePrivate Sub Command1_Click() End SubText1.Text = Text1.Text & 1End Sub Private Sub Command16_Click() num1 = Text1.TextPrivate Sub Command10_Click() Text1.Text = ""Text1.Text = Text1.Text & 0 op = "*"End Sub Command16.Visible = False Command22.Visible = TruePrivate Sub Command11_Click() End SubText1.Text = Text1.Text & "."End Sub Private Sub Command17_Click() Text1.Text = "0"Private Sub Command12_Click() End Subnum2 = Text1.TextIf op = "+" Then Private Sub Command19_Click()Text1.Text = num1 + num2 num2 = Text1.TextElseIf op = "/" Then If op = "+" ThenText1.Text = num1 / num2 Text1.Text = num1 + num2ElseIf op = "*" Then ElseIf op = "/" ThenText1.Text = num1 * num2 Text1.Text = num1 / num2ElseIf op = "-" Then ElseIf op = "*" ThenText1.Text = num1 - num2 Text1.Text = num1 * num2End If ElseIf op = "-" ThenEnd Sub Text1.Text = num1 - num2 End IfPrivate Sub Command13_Click() Command13.Visible = Truenum1 = Text1.Text Command19.Visible = FalseText1.Text = "" End Subop = "+"Command13.Visible = False Private Sub Command2_Click()Command19.Visible = True Text1.Text = Text1.Text & 2End Sub End SubPrivate Sub Command14_Click() Private Sub Command20_Click()num1 = Text1.Text num2 = Text1.TextText1.Text = "" If op = "+" Thenop = "-" Text1.Text = num1 + num2Command14.Visible = False ElseIf op = "/" ThenCommand20.Visible = True Text1.Text = num1 / num2End Sub ElseIf op = "*" Then Text1.Text = num1 * num2
  • 2. ElseIf op = "-" Then Command16.Visible = TrueText1.Text = num1 - num2 Command22.Visible = FalseEnd If End SubCommand14.Visible = TrueCommand20.Visible = False Private Sub Command3_Click()End Sub Text1.Text = Text1.Text & 3 End SubPrivate Sub Command21_Click()num2 = Text1.Text Private Sub Command4_Click()If op = "+" Then Text1.Text = Text1.Text & 4Text1.Text = num1 + num2 End SubElseIf op = "/" ThenText1.Text = num1 / num2 Private Sub Command5_Click()ElseIf op = "*" Then Text1.Text = Text1.Text & 5Text1.Text = num1 * num2 End SubElseIf op = "-" ThenText1.Text = num1 - num2 Private Sub Command6_Click()End If Text1.Text = Text1.Text & 6End Sub End SubPrivate Sub Command22_Click() Private Sub Command7_Click()num2 = Text1.Text Text1.Text = Text1.Text & 7If op = "+" Then End SubText1.Text = num1 + num2ElseIf op = "/" Then Private Sub Command8_Click()Text1.Text = num1 / num2 Text1.Text = Text1.Text & 8ElseIf op = "*" Then End SubText1.Text = num1 * num2ElseIf op = "-" Then Private Sub Command9_Click()Text1.Text = num1 - num2 Text1.Text = Text1.Text & 9End If End Sub
  • 3. Addition: Subtraction:
  • 4. Division: Multiplication:Calculator in TASM:
  • 5. Addition:Subtraction:
  • 6. Division:Multiplication:,

×