VBA如何将*用作字符,而不是单元格的通配符。公式如

时间:2022-09-01 23:17:28

I am trying to write an If statement to differentiate between formulas with "=100*..." and "=1000*..." with the * being a multiplier not a wildcard.

我想写一个If语句来区分“=100*…”和“=1000*…”的公式,其中*是乘数而不是通配符。

Ex. If (Cell.Formula Like "=100*") = True Then ...

如果(细胞。公式如“=100*”= True则…

however both cases are deemed true. Also I tried

然而,这两种情况都被认为是真实的。我也试过

If (Cell.Formula Like "=100~*") = True Then and it didn't work. How do I get the asterisk to be used as a multiply sign

如果细胞。公式如“=100~*”=当时为真,但没有用。如何让星号用作正负号

1 个解决方案

#1


1  

Use the InStr function.

使用InStr函数。

if cbool(instr(1, cell.formula, "=100*", vbbinarycompare))) then

#1


1  

Use the InStr function.

使用InStr函数。

if cbool(instr(1, cell.formula, "=100*", vbbinarycompare))) then