您好,发现了两个问题,
1. 公式应该是 rc3="A", 文本需要用双引号引用
2. 第一列设置的时候 columnCount应该是1
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- sh.ClearConditionalFormatings()
- Dim unary As New FarPoint.Win.Spread.FormulaConditionalFormattingRule(Me.TextBox1.Text.Trim())
- unary.BackColor = Color.Red
- sh.SetConditionalFormatting(0, 0, sh.RowCount, 1, True, unary)
- End Sub
复制代码 |