返回列表 上一主題 發帖

[發問] 對應欄位問題

If ln(ct2, cts + 1) <> 0 And (ln(ct2, cts + 1) <> 174 And ln(ct2, cts + 1) <> 175 And ln(ct2, cts + 1) <> 254 And ln(ct2, cts + 1) <> 255) Then
174-175-254-255 是"列號", ln(ct2, cts + 1) 是"數字", 怎對得上???


另, 程式還須考慮"可讀性", 會多次引用的, 儘量以變數代替, 免看得眼花,
IIF 這方式也可以簡化, 看起來也較易了解:
ar(cts, 1) = IIf(ar(cts, 1) = "", ln(ct2, 1) & IIf(ln(ct2, cts + 1) > 0, "+", "") & ln(ct2, cts + 1), _
                                        ar(cts, 1) & "," & ln(ct2, 1) & IIf(ln(ct2, cts + 1) > 0, "+", "") & ln(ct2, cts + 1))

t$ = Format(ln(ct2, cts + 1), "+0;-0")
ar(cts, 1) = Replace(Trim(ar(cts, 1) & " " & ln(ct2, 1) & t), " ", ",")

TOP

        靜思自在 : 人生沒有所有權,只有生命的使用權。
返回列表 上一主題