10/11/2023, 22:31
feraz
Kod ile istersenizde alttaki olabilir.
PHP Kod:
Sub ToplaArray()
Dim topla As Double, arr, i As Long, ii As Long, arr2
Dim syf As Worksheet
Set syf = ThisWorkbook.Worksheets("Sayfa1")
son = syf.Cells(Rows.Count, "F").End(3).Row
syf.Range("H2:H" & Rows.Count).ClearContents
If son < 2 Then Exit Sub
ReDim arr2(1 To son, 1 To 1)
With CreateObject("vbscript.regexp")
.Pattern = "[^0-9]"
.Global = True
.IgnoreCase = True
For i = 2 To son
topla = 0
arr = Split(Trim(.Replace(syf.Range("G" & i).Value, " ")), " ")
For ii = 0 To UBound(arr)
If IsNumeric(arr(ii)) = True Then topla = topla + CDbl(arr(ii))
Next
arr2(i - 1, 1) = topla
Next
End With
syf.Range("H2").Resize(UBound(arr2) - 1, 1).Value = arr2
Set syf = Nothing
End Sub