Welcome to Minetown!
To join our community, please login or register!
Internet Explorer
Internet Explorer is not supported. Please upgrade to a more modern browser.

[Enjin Archive] VBA question
Started by [E] Reggief

Hey can anyone help me with this question from my assignment?

iwk03.png

Just like some of the basic commands for making the msg box prompt a input box and all that jazz
I need to know once I pick the shape how I get the area when I type in a number
im not that far into programming myself so i cant help sorry
I dont know the syntax for VBA but it do know a little C++ and C#,

I think you just need a simple conditional statement like:

If (shapevalue == 1) then (Area = length of side 1 * lenght of side 2)

Else (shapevalue==2) then (Area = ...

then after the conditional statements, use whatever function displays the value like Display.Area cout>>"Area =">>Area or something
yeah i have something like that

this is what I have so far. That will let me select the square and say a length to show me a value for area
Code:
Public Sub shapeArea() Dim pickShape As String Dim pickArea As Integer Dim squareArea As Integer pickShape = InputBox(prompt:="Please pick one of three shapes:" & vbCrLf & vbCrLf & "Square = 1" & vbCrLf & vbCrLf & "Triangle = 2" & vbCrLf & vbCrLf & "Circle = 3", Title:="Select A Shape", Default:="Type shape here") If pickShape = "Type shape here" Then Exit Sub ElseIf pickShape = "1" Then pickArea = InputBox(prompt:="Please enter the length of a side of the square:") If (pickArea > 0) Then squareArea = (pickArea * pickArea) MsgBox squareArea End If End If End Sub
Anyone know how to make it so a number is superscript? I want my msgbox to say m^2
Just google it
I have googled this shit. That dosent always work.
Google lies!

Look what it came up with when I put my name in:

WTF IS ON HER HEAD D:
Its all finished meow. Thanks mrbaconbittts