Merhaba. Excel de ilk defa code yazıyorum. Kodum şöyle
Sub coefficients()
Dim a_coeff, b_coeff As Double
Worksheets("Sheet1").Activate
Column("O").Range
If Column("O") >= 2.5 Then x = (Tdb) + (e_ - es) / (0.000662 * pressure)
Else
If Column("O") < 0.5 And Column("O") = 0.5 Then a_coeff = 0.0012
If Column("O") > 1 And wind = 1 And Column("O") < 1.5 And Column("O") = 1.5 Then a_coeff = 0.0008
If Column("O") > 1.5 And Column("O") < 2.5 Then a_coeff = 0.000656
If Column("O") > 0 And Column("O") < 2.5 Then b_coeff = 610
x = (-(b_coeff - Tdb) + ((b_coeff - Tdb) ^ 2 - 4 * 1 * ((e_ - es) / (-a_coeff * pressure) - Tdb)) ^ 1 / 2) / 2 * 1
End Sub
İnternetten baka baka birşeyler yapmaya çalıştım ama pek başarılı olamadım. Kodumun worksheet 1'in "O" column unun 17. rowun dan başlayarak tek tek verileri almasını ve a_coeff ve b_coeff leri hesaplayarak excel sheetinde x column ı oluşturmasını istiyorum. ama worksheeti aktif yapabildim mi ve o column ı nasıl macro anlayabilir bunları bilmiyorum. Yardımlarınız için şimdiden sonsuz teşekkür ediyorum.
Sub coefficients()
Dim a_coeff, b_coeff As Double
Worksheets("Sheet1").Activate
Column("O").Range
If Column("O") >= 2.5 Then x = (Tdb) + (e_ - es) / (0.000662 * pressure)
Else
If Column("O") < 0.5 And Column("O") = 0.5 Then a_coeff = 0.0012
If Column("O") > 1 And wind = 1 And Column("O") < 1.5 And Column("O") = 1.5 Then a_coeff = 0.0008
If Column("O") > 1.5 And Column("O") < 2.5 Then a_coeff = 0.000656
If Column("O") > 0 And Column("O") < 2.5 Then b_coeff = 610
x = (-(b_coeff - Tdb) + ((b_coeff - Tdb) ^ 2 - 4 * 1 * ((e_ - es) / (-a_coeff * pressure) - Tdb)) ^ 1 / 2) / 2 * 1
End Sub
İnternetten baka baka birşeyler yapmaya çalıştım ama pek başarılı olamadım. Kodumun worksheet 1'in "O" column unun 17. rowun dan başlayarak tek tek verileri almasını ve a_coeff ve b_coeff leri hesaplayarak excel sheetinde x column ı oluşturmasını istiyorum. ama worksheeti aktif yapabildim mi ve o column ı nasıl macro anlayabilir bunları bilmiyorum. Yardımlarınız için şimdiden sonsuz teşekkür ediyorum.
