本帖最后由 suye1010 于 2014-1-20 10:08 编辑
- Private Sub Worksheet_Change(ByVal Target As Range)
- With Sheets("个人缴费卡片")
- .Unprotect ("695360052")
- Dim rng
- For Each rng In Target
- If Intersect(rng, Range("c14:c25,g14:g25,k14:k25,o14:o25,s14:s25,c31:c42,g31:g42,k31:k42,o31:o42,s31:s42,c48:c59,g48:g59,k48:k59,o48:o59,s48:s59,c65:c76,g65:g76,k65:k76,o65:o76,s65:s76,c82:c93,g82:g93,k82:k93,o82:o93,s82:s93")) Is Nothing Then
- GoTo 100
- Else
- If CStr(rng.Value) = rng.Formula Then rng.Font.Color = vbRed: rng.Font.Bold = True
- End If
- Next
- 100:
- .Protect ("695360052")
- End With
- End Sub
复制代码 |