SlideShare a Scribd company logo
1 of 36
BBW-301
EXTERNAL PROJECT
PRESENTED BY:
SHUBHAM KUSHWAHA (167554)
SHREYANS JAIN (167553)
SHOURYA VERMA (167552)
Frame
Command
Button Back
Command
Button Close
User Form
Command
Button Clear
7
4
1
0
5
9
2
Close
/
6 *
-
8
. =
Sin
+
Cos Tan
Log Ln Sqrt %
Mod 10^x Inv ^
3
+/-
Clear Back
Text Box
CLEAR BUTTON
• Private Sub cmdbtnclr_Click()
• txtRes = 0: txtDisplay = Empty
• End Sub
BACK BUTTON
• Private Sub cmdBtnBak_Click()
• If txtRes <> 0 And txtRes <> "" Then txtRes =
Left(txtRes, Len(txtRes) - 1)
• End Sub
CLOSE BUTTON
• Private Sub cmdClose_Click()
• Unload Me
• End Sub
0 BUTTON
• Private Sub cmdBtn0_Click()
• txtRes = txtRes + cmdBtn0.Caption
• End Sub
. BUTTON
• Private Sub cmdBtnDot_Click()
• If txtRes <> 0 Then txtRes = txtRes + "."
• End Sub
1 BUTTON
• Private Sub cmdBtn1_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn1.Caption
• Else
• txtRes = txtRes + cmdBtn1.Caption
• End If
• End Sub
2 BUTTON
• Private Sub cmdBtn2_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn2.Caption
• Else
• txtRes = txtRes + cmdBtn2.Caption
• End If
• End Sub
3 BUTTON
• Private Sub cmdBtn3_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn3.Caption
• Else
• txtRes = txtRes + cmdBtn3.Caption
• End If
• End Sub
4 BUTTON
• Private Sub cmdBtn4_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn4.Caption
• Else
• txtRes = txtRes + cmdBtn4.Caption
• End If
• End Sub
5 BUTTON
• Private Sub cmdBtn5_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn5.Caption
• Else
• txtRes = txtRes + cmdBtn5.Caption
• End If
• End Sub
6 BUTTON
• Private Sub cmdBtn6_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn6.Caption
• Else
• txtRes = txtRes + cmdBtn6.Caption
• End If
• End Sub
7 BUTTON
• Private Sub cmdBtn7_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn7.Caption
• Else
• txtRes = txtRes + cmdBtn7.Caption
• End If
• End Sub
8 BUTTON
• Private Sub cmdBtn8_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn8.Caption
• Else
• txtRes = txtRes + cmdBtn8.Caption
• End If
• End Sub
9 BUTTON
• Private Sub cmdBtn9_Click()
• If txtRes = 0 Then
• txtRes = cmdBtn9.Caption
• Else
• txtRes = txtRes + cmdBtn9.Caption
• End If
• End Sub
DIVISION BUTTON
• Private Sub cmdBtnDvd_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnDvd.Caption
• Else
• txtRes = txtRes + cmdBtnDvd.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Divide"
• End If
• End Sub
MULTIPLICATION BUTTON
• Private Sub cmdBtnMult_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnMult.Caption
• Else
• txtRes = txtRes + cmdBtnMult.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Multiplication"
• End If
• End Sub
ADDITION BUTTON
• Private Sub cmdBtnAdd_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnAdd.Caption
• Else
• txtRes = txtRes + cmdBtnAdd.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Add"
• End If
• End Sub
SUBSTRACTION BUTTON
• Private Sub cmdBtnMns_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnMns.Caption
• Else
• txtRes = txtRes + cmdBtnMns.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Minus"
• End If
• End Sub
EQUALS TO BUTTON
SIN BUTTON
• Private Sub cmdBtnSin_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnSin.Caption
• Else
• txtRes = txtRes + cmdBtnSin.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Sine"
• End If
• End Sub
COS BUTTON
• Private Sub cmdBtnCos_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnCos.Caption
• Else
• txtRes = txtRes + cmdBtnCos.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Cosine"
• End If
• End Sub
TAN BUTTON
• Private Sub cmdBtnTan_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnTan.Caption
• Else
• txtRes = txtRes + cmdBtnTan.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Tangent"
• End If
• End Sub
+/- BUTTON
• Private Sub cmdBtnPlusMinus_Click()
• txtRes = "-" & txtDisplay
• End Sub
LOG BUTTON
• Private Sub cmdBtnLog_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnLog.Caption
• Else
• txtRes = txtRes + cmdBtnLog.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Logarithm"
• End If
• End Sub
LN BUTTON
• Private Sub cmdBtnLn_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnLn.Caption
• Else
• txtRes = txtRes + cmdBtnLn.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Pure Logarithm"
• End If
• End Sub
SQUARE ROOT BUTTON
• Private Sub cmdBtnSqrt_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnSqrt.Caption
• Else
• txtRes = txtRes + cmdBtnSqrt.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Square Root"
• End If
• End Sub
% BUTTON
• Private Sub cmdBtnPerc_Click()
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• End If
• txtRes = txtDisplay.Text / 100
• MsgBox "Your Answer is " & txtRes.Text
• End Sub
MOD BUTTON
• Private Sub cmdBtnMod_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnMod.Caption
• Else
• txtRes = txtRes + cmdBtnMod.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Modulus"
• End If
• End Sub
10^x BUTTON
• Private Sub cmdBtnTentoX_Click()
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Ten^x"
• End If
• txtRes = 10 ^ txtDisplay.Text
• MsgBox "Your Answer is " & txtRes.Text
• End Sub
INV BUTTON
• Private Sub cmdBtnInv_Click()
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Inverse"
• End If
• txtRes = txtDisplay.Text ^ -1
• MsgBox "Your Answer is " & txtRes.Text
• End Sub
^ BUTTON
• Private Sub cmdBtnExp_Click()
• If txtRes = 0 Then
• txtRes = cmdBtnExp.Caption
• Else
• txtRes = txtRes + cmdBtnExp.Caption
• End If
• If txtRes <> 0 Then
• txtDisplay = txtRes
• txtRes = 0
• calVal = "Exponential"
• End If
• End Sub
TEXT BOX
• Private Sub txtRes_Change()
• If txtRes.TextLength > 21 Then
• txtRes.Text = Left(txtRes.Text, 21)
• Exit Sub
• End If
• End Sub
USER FORM
• Private Sub UserForm_Initialize()
• txtRes.MaxLength = 21
• txtDisplay.MaxLength = 21
• End Sub
THANK YOU

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

VBA Project- Scientific Calculator

  • 1. BBW-301 EXTERNAL PROJECT PRESENTED BY: SHUBHAM KUSHWAHA (167554) SHREYANS JAIN (167553) SHOURYA VERMA (167552)
  • 2. Frame Command Button Back Command Button Close User Form Command Button Clear 7 4 1 0 5 9 2 Close / 6 * - 8 . = Sin + Cos Tan Log Ln Sqrt % Mod 10^x Inv ^ 3 +/- Clear Back Text Box
  • 3. CLEAR BUTTON • Private Sub cmdbtnclr_Click() • txtRes = 0: txtDisplay = Empty • End Sub
  • 4. BACK BUTTON • Private Sub cmdBtnBak_Click() • If txtRes <> 0 And txtRes <> "" Then txtRes = Left(txtRes, Len(txtRes) - 1) • End Sub
  • 5. CLOSE BUTTON • Private Sub cmdClose_Click() • Unload Me • End Sub
  • 6. 0 BUTTON • Private Sub cmdBtn0_Click() • txtRes = txtRes + cmdBtn0.Caption • End Sub
  • 7. . BUTTON • Private Sub cmdBtnDot_Click() • If txtRes <> 0 Then txtRes = txtRes + "." • End Sub
  • 8. 1 BUTTON • Private Sub cmdBtn1_Click() • If txtRes = 0 Then • txtRes = cmdBtn1.Caption • Else • txtRes = txtRes + cmdBtn1.Caption • End If • End Sub
  • 9. 2 BUTTON • Private Sub cmdBtn2_Click() • If txtRes = 0 Then • txtRes = cmdBtn2.Caption • Else • txtRes = txtRes + cmdBtn2.Caption • End If • End Sub
  • 10. 3 BUTTON • Private Sub cmdBtn3_Click() • If txtRes = 0 Then • txtRes = cmdBtn3.Caption • Else • txtRes = txtRes + cmdBtn3.Caption • End If • End Sub
  • 11. 4 BUTTON • Private Sub cmdBtn4_Click() • If txtRes = 0 Then • txtRes = cmdBtn4.Caption • Else • txtRes = txtRes + cmdBtn4.Caption • End If • End Sub
  • 12. 5 BUTTON • Private Sub cmdBtn5_Click() • If txtRes = 0 Then • txtRes = cmdBtn5.Caption • Else • txtRes = txtRes + cmdBtn5.Caption • End If • End Sub
  • 13. 6 BUTTON • Private Sub cmdBtn6_Click() • If txtRes = 0 Then • txtRes = cmdBtn6.Caption • Else • txtRes = txtRes + cmdBtn6.Caption • End If • End Sub
  • 14. 7 BUTTON • Private Sub cmdBtn7_Click() • If txtRes = 0 Then • txtRes = cmdBtn7.Caption • Else • txtRes = txtRes + cmdBtn7.Caption • End If • End Sub
  • 15. 8 BUTTON • Private Sub cmdBtn8_Click() • If txtRes = 0 Then • txtRes = cmdBtn8.Caption • Else • txtRes = txtRes + cmdBtn8.Caption • End If • End Sub
  • 16. 9 BUTTON • Private Sub cmdBtn9_Click() • If txtRes = 0 Then • txtRes = cmdBtn9.Caption • Else • txtRes = txtRes + cmdBtn9.Caption • End If • End Sub
  • 17. DIVISION BUTTON • Private Sub cmdBtnDvd_Click() • If txtRes = 0 Then • txtRes = cmdBtnDvd.Caption • Else • txtRes = txtRes + cmdBtnDvd.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Divide" • End If • End Sub
  • 18. MULTIPLICATION BUTTON • Private Sub cmdBtnMult_Click() • If txtRes = 0 Then • txtRes = cmdBtnMult.Caption • Else • txtRes = txtRes + cmdBtnMult.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Multiplication" • End If • End Sub
  • 19. ADDITION BUTTON • Private Sub cmdBtnAdd_Click() • If txtRes = 0 Then • txtRes = cmdBtnAdd.Caption • Else • txtRes = txtRes + cmdBtnAdd.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Add" • End If • End Sub
  • 20. SUBSTRACTION BUTTON • Private Sub cmdBtnMns_Click() • If txtRes = 0 Then • txtRes = cmdBtnMns.Caption • Else • txtRes = txtRes + cmdBtnMns.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Minus" • End If • End Sub
  • 22. SIN BUTTON • Private Sub cmdBtnSin_Click() • If txtRes = 0 Then • txtRes = cmdBtnSin.Caption • Else • txtRes = txtRes + cmdBtnSin.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Sine" • End If • End Sub
  • 23. COS BUTTON • Private Sub cmdBtnCos_Click() • If txtRes = 0 Then • txtRes = cmdBtnCos.Caption • Else • txtRes = txtRes + cmdBtnCos.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Cosine" • End If • End Sub
  • 24. TAN BUTTON • Private Sub cmdBtnTan_Click() • If txtRes = 0 Then • txtRes = cmdBtnTan.Caption • Else • txtRes = txtRes + cmdBtnTan.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Tangent" • End If • End Sub
  • 25. +/- BUTTON • Private Sub cmdBtnPlusMinus_Click() • txtRes = "-" & txtDisplay • End Sub
  • 26. LOG BUTTON • Private Sub cmdBtnLog_Click() • If txtRes = 0 Then • txtRes = cmdBtnLog.Caption • Else • txtRes = txtRes + cmdBtnLog.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Logarithm" • End If • End Sub
  • 27. LN BUTTON • Private Sub cmdBtnLn_Click() • If txtRes = 0 Then • txtRes = cmdBtnLn.Caption • Else • txtRes = txtRes + cmdBtnLn.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Pure Logarithm" • End If • End Sub
  • 28. SQUARE ROOT BUTTON • Private Sub cmdBtnSqrt_Click() • If txtRes = 0 Then • txtRes = cmdBtnSqrt.Caption • Else • txtRes = txtRes + cmdBtnSqrt.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Square Root" • End If • End Sub
  • 29. % BUTTON • Private Sub cmdBtnPerc_Click() • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • End If • txtRes = txtDisplay.Text / 100 • MsgBox "Your Answer is " & txtRes.Text • End Sub
  • 30. MOD BUTTON • Private Sub cmdBtnMod_Click() • If txtRes = 0 Then • txtRes = cmdBtnMod.Caption • Else • txtRes = txtRes + cmdBtnMod.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Modulus" • End If • End Sub
  • 31. 10^x BUTTON • Private Sub cmdBtnTentoX_Click() • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Ten^x" • End If • txtRes = 10 ^ txtDisplay.Text • MsgBox "Your Answer is " & txtRes.Text • End Sub
  • 32. INV BUTTON • Private Sub cmdBtnInv_Click() • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Inverse" • End If • txtRes = txtDisplay.Text ^ -1 • MsgBox "Your Answer is " & txtRes.Text • End Sub
  • 33. ^ BUTTON • Private Sub cmdBtnExp_Click() • If txtRes = 0 Then • txtRes = cmdBtnExp.Caption • Else • txtRes = txtRes + cmdBtnExp.Caption • End If • If txtRes <> 0 Then • txtDisplay = txtRes • txtRes = 0 • calVal = "Exponential" • End If • End Sub
  • 34. TEXT BOX • Private Sub txtRes_Change() • If txtRes.TextLength > 21 Then • txtRes.Text = Left(txtRes.Text, 21) • Exit Sub • End If • End Sub
  • 35. USER FORM • Private Sub UserForm_Initialize() • txtRes.MaxLength = 21 • txtDisplay.MaxLength = 21 • End Sub