rivate Sub Worksheet_Change(ByVal Target As Range) If Target.Row > 4 Then Exit Sub If Target.Column > 3 Then Exit Sub If Not IsNumeric(Target) Then MsgBox "只能輸入數(shù)值" Target = "" End If End Sub理解了。原來不會(huì)寫是因?yàn)闆]弄懂ByVal Target As Range。再請(qǐng)問一下,如何運(yùn)行呢?原來寫sub xx()點(diǎn)綠色運(yùn)行鍵就可以運(yùn)行了。這個(gè)不行。Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row > 4 Then Exit SubSub a() Dim rng As Range For Each rng In Selection MsgBox rng.Value & vbLf & rng.Address & vbLf & IsNumeric(rng) Next End Sub魂斷藍(lán)橋 發(fā)表于 2018-8-8 08:58 Sub a() Dim rng As Range For Each rng In Selection |
|