Selamlar. yine bir ödevde takıldım ödevim şu
Yapılması gereken işlemleri içeren makroyu yazdım ama burda benden girdileri inputbox yerine hücre içinden almamı istiyor. Forumda ne kadar araştırma yaptıysam bulamadım. Yardımcı olabilirmisiniz? Yazdığım makroyu ( input boxlu yazdım ne yazık ki) ekliyorum. Kodumun son hali henüz bu değil ama çözmem gereken kısım sadece yukarıda sorduğum kısım.
Kod:
Option Explicit
Function Qliq(m, csliq, Tliq) As Double
csliq = 4.18
Tliq = 100
Qliq = m * csliq * Tliq
End Function
Sub example4()
Dim m, b, c As Double
Dim n As Double
Dim Qliqste As Double, Qiceliq As Double
Dim Hfus As Double, Hvap As Double
Dim csice As Double, csliq As Double, csste As Double
Dim Tice As Double, Tste As Double, Tliq As Double
Dim Totalheat As Double
Dim Qice As Double, Qste As Double
MsgBox "This program calculate the total heat required to vaporize given amount of ice"
m = InputBox("Please enter the mass of ice")
b = InputBox("Please enter the initial temp of ice")
c = InputBox("Please enter the final temp of steam")
If b <= 0 And c >= 100 Then
n = m / 18
Hfus = 6.01
Hvap = 40.67
Qiceliq = n * Hfus
Qliqste = n * Hvap
csice = 2.03
Tice = 0 - b
Qice = m * csice * Tice
csste = 1.84
Tste = c - 100
Qste = m * csste * Tste
Totalheat = Qice + Qliq(m, csliq, Tliq) + Qste + Qiceliq + Qliqste
Totalheat = Format(Totalheat, "0.00")
MsgBox "The required total heat is: " & Totalheat & " J"
Else
MsgBox ("inputs doesnt meet req complicatiosn")
End If
End Sub