作者tina1688
看板Office
標題[算表] VBA_IF判斷文字顯示問題
時間Fri Dec 27 17:22:57 2019
大大又來請教
以下程式判斷>2
照理說應該文字要算n
但實際跑y
可以幫忙解惑嗎?是要用其他函數嗎?
謝謝喔
https://i.imgur.com/2n1sFfq.jpg
Sub test()
If Range("A" & ActiveCell.Row) > 2 Then
Range("B" & ActiveCell.Row) = "y"
Else
Range("B" & ActiveCell.Row) = "n"
End If
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 101.12.0.92 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Office/M.1577438579.A.42E.html
※ 編輯: tina1688 (101.12.0.92 臺灣), 12/27/2019 17:24:15
1F:→ soyoso: 加個判斷isnumeric 12/27 17:32
2F:→ soyoso: ... > 2 and isnumeric(range("a" &....)) 12/27 17:38
3F:→ tina1688: 感謝感謝感謝!!!!S大大!!!!!!!!!!! 12/27 17:45