In: Computer Science
Make an Excel VBA code for this function x=(log(50)+2.2680)/(0.3046)
The answer should be around 13.0233
Also how to declare a value example
Dim i = 0.3258
x = i * Range("A1").Value
because the answer becomes 0 or sometimes it's just value of A1
Short Summary:
Question 1:
Make an Excel VBA code for this function x=(log(50)+2.2680)/(0.3046)
The answer should be around 13.0233
Source Code:
Function GetValue() As Double
Dim x As Double
x = (Log(50) + 2.268) / (0.3046)
GetValue = x
End Function
Sub Display()
MsgBox GetValue()
End Sub
Sample Run:
Question 2:
how to declare a value example
Dim i = 0.3258
x = i * Range("A1").Value
because the answer becomes 0 or sometimes it's just value of A1
Source Code:
Function GetValue() As Double
Dim i As Double
i = 0.3258
Dim x As Double
x = i * Range("A1").Value
GetValue = x
End Function
Sub Display()
MsgBox GetValue()
End Sub
Sample Run:
**************************************************************************************
Feel free to rate the answer and comment your questions, if you have any.
Please upvote the answer and appreciate our time.
Happy Studying!!!
**************************************************************************************