Basically Once This code ends i make a msgbox asking if you want to run it again. If yes then it runs, but i want to do it infinitely till you tell it no. I think i could do it with do until so I pretty much got that.
This issue is how do I tell it to put the new set of data under the previous. Also not that the original data table range is selected by the user.
This issue is how do I tell it to put the new set of data under the previous. Also not that the original data table range is selected by the user.
Code:
height = InputBox("What is height of theodolite" & height)
distance = InputBox("What is the distance from building" & distance)
theta = InputBox("What is the angle theta" & theta)
Result = BuildingHeight(height, theta, distance)
MsgBox Result
MSG1 = MsgBox("Would you like to print data to worksheet?", vbYesNo)
If MSG1 = vbNo Then
Exit Sub
End If
If MSG1 = vbYes Then
Set MyRange = Application.InputBox("Select Range", Type:=8)
MyRange.Select
MyRange.Value = "Height of theolodite"
ActiveCell.Offset(0, 1) = "Theta"
ActiveCell.Offset(0, 2) = "Distance to Building"
ActiveCell.Offset(0, 3) = "Result"
ActiveCell.Offset(1, 0).Value = height
ActiveCell.Offset(1, 1).Value = theta
ActiveCell.Offset(1, 2).Value = distance
ActiveCell.Offset(1, 3).Value = Result
End If
MSG2 = MsgBox("Would you like to play again", vbYesNo)
Do Until MSG2 = vbNo
Loop
If MSG2 = vbYes Then