- Katılım
- 30 Mayıs 2013
- Mesajlar
- 2
- Excel Vers. ve Dili
- Excel 2010 VBA
Function Country() ' ülke tanımlama
Dim bugun_tarih
Dim i As Integer
bugun_tarih = Now()
Set s1 = Sheets("FUEL")
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System Is Nothing) Then
MsgBox "Başlamak için Sessions 1'yi Açın!!!"
Exit Function
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "Başlamak için Sessions 1'yi Açın!!!"
Exit Function
End If
'-----------------------------------------------------------------------------------------------
g_HostSettleTime = 300 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Başlamak için Sessions 1'yi Açın!!!"
Exit Function
End If
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
'-----------------------------------------------------------------------------------------------
For i = 2 To 1000 Step 1
linebuf$ = Sheet6.Cells(i, 1)
If linebuf = "" Then
Exit Function
Else
linebuf$ = Sheet6.Cells(i, 3)
If linebuf = "" Then
Sess0.Screen.SendKeys "LIM,DIS," & Sheet6.Cells(i, 1)
Sess0.Screen.SendKeys "<Enter>"
linebuf$ = Sess0.Screen.Area(22, 24, 22, 33, xBlock)
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
If linebuf = "BULUNAMADI" Then
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
GoTo Son:
Else
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
linebuf$ = Sess0.Screen.Area(13, 38, 13, 39, xBlock)
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
End If
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
s1.Cells(i, 3) = linebuf
Sess0.Screen.SendKeys "<Enter>"
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Else
End If
End If
linebuf$ = Cells(i, 2)
If (linebuf = "") Then
s1.Cells(i, 7)= Application.WorksheetFunction.AverageIfs(Sheet6.Range("B2:Bi"), Cells(i, 3), Sheet6.Range("C2:Ci"))
Else
End If
Son:
Next
End Function
Arkadaşlar Merhaba,
Averageifs'de 1004 hatasını alıyorum.
Amacım boş hücreler var ise averageifs fonksiyonunu çalıştırarak aynı hücreye yazdırmak.
Yardımcı olursanız sevinirim.
Teşekkürler.
Dim bugun_tarih
Dim i As Integer
bugun_tarih = Now()
Set s1 = Sheets("FUEL")
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System Is Nothing) Then
MsgBox "Başlamak için Sessions 1'yi Açın!!!"
Exit Function
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "Başlamak için Sessions 1'yi Açın!!!"
Exit Function
End If
'-----------------------------------------------------------------------------------------------
g_HostSettleTime = 300 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Başlamak için Sessions 1'yi Açın!!!"
Exit Function
End If
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
'-----------------------------------------------------------------------------------------------
For i = 2 To 1000 Step 1
linebuf$ = Sheet6.Cells(i, 1)
If linebuf = "" Then
Exit Function
Else
linebuf$ = Sheet6.Cells(i, 3)
If linebuf = "" Then
Sess0.Screen.SendKeys "LIM,DIS," & Sheet6.Cells(i, 1)
Sess0.Screen.SendKeys "<Enter>"
linebuf$ = Sess0.Screen.Area(22, 24, 22, 33, xBlock)
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
If linebuf = "BULUNAMADI" Then
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
GoTo Son:
Else
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
linebuf$ = Sess0.Screen.Area(13, 38, 13, 39, xBlock)
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
End If
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
s1.Cells(i, 3) = linebuf
Sess0.Screen.SendKeys "<Enter>"
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Else
End If
End If
linebuf$ = Cells(i, 2)
If (linebuf = "") Then
s1.Cells(i, 7)= Application.WorksheetFunction.AverageIfs(Sheet6.Range("B2:Bi"), Cells(i, 3), Sheet6.Range("C2:Ci"))
Else
End If
Son:
Next
End Function
Arkadaşlar Merhaba,
Averageifs'de 1004 hatasını alıyorum.
Amacım boş hücreler var ise averageifs fonksiyonunu çalıştırarak aynı hücreye yazdırmak.
Yardımcı olursanız sevinirim.
Teşekkürler.
