首先我用左if cell X1 value>3,true=’>‘,false=’<‘ 出個好睇d既presentation
之後我要根據佢既cell X1 answer係大過or細過3而要用唔同既formula做第二個step,例如如果x>3,cell Z1=cell A1+cell B1,<3就Z1=A1*B1
呢個時候第二個if 應該點樣寫?研究左一個鐘

Option Explicit
Sub test()
Dim regExp As Object
Dim str As String
Dim replaced_str As String
Dim replaced_str_array As Variant
Dim i As Long, j As Long
Dim result_array() As Long
Set regExp = CreateObject("vbscript.RegExp") 'late binding
str = "hfgh12hfbk34ggh4"
regExp.Pattern = "[^0-9]"
regExp.Global = True
If regExp.test(str) Then
replaced_str = regExp.Replace(str, ",")
End If
replaced_str_array = Split(replaced_str, ",")
j = 0
For i = LBound(replaced_str_array) To UBound(replaced_str_array)
If replaced_str_array(i) <> "" Then
j = j + 1
End If
Next i
ReDim result_array(0 To j - 1)
j = 0
For i = LBound(replaced_str_array) To UBound(replaced_str_array)
If replaced_str_array(i) <> "" Then
result_array(j) = CInt(replaced_str_array(i))
j = j + 1
End If
Next i
End Sub
na.omit(as.numeric(strsplit(gsub("[^0-9]", ",", "hfgh12hfbk34ggh4"), ",")[[1]]))