ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦b³æ¤@Äæ¦ì¤¤­pºâ¦³µL­t­È

[µo°Ý] ¦b³æ¤@Äæ¦ì¤¤­pºâ¦³µL­t­È

¦bAÄ椤­pºâÄæ¦ì¦³µL­t­È
¦p¤u§@ªí1


¼gªºµ{¦¡½X¦p¤U:
  1. Sub CheckNegativeNumber()
  2. Dim ng As Integer

  3. Worksheets("¤u§@ªí1").Activate

  4. Range("A500").FormulaR1C1 = "=COUNTIF(R[-499]C:R[-1]C,""<0"")"
  5. ng = Range("A500").Value
  6. MsgBox "­t¼Æ¦@¦³ :" & ng & "µ§"

  7. End Sub
½Æ»s¥N½X
²{¦bªº°ÝÃD¬OAÄ檺¸ê®Æ¥Ø«e¨S¦³«Ü¦h
©Ò¥H¥ý³]©w¦bA500³oÀx¦s®æ¤U¤½¦¡
¦ý¥¼¨Ó¦pªG¶W¹L500µ§´N¥²¶·¦b­×§ïµ{¦¡½X

¦³¤°»ò¤èªk¥i¥H¤£­n«ü©wÀx¦s®æ
ª½±µ·j´M¥Ø«eªºÄæ¦ì¦³µL­t­È¡A«á¥ÎMsgBoxÅã¥Ü¥X­t¼Æ¦³´Xµ§~~

³Â·Ð¦U¦ì¤F~~Thank you :)

¦^´_ 7# GBKEE


ÁÂÁ±z´£¨Ñªºµ{¦¡½X~µ²ªG¬O¦¨¥\ªº­ò

TOP

¦^´_ 6# Changbanana
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub CNN()
  3.     Dim ng As Integer
  4.     Dim rg  As Range
  5.     Dim row As Long
  6.     Set rg = Worksheets("¤u§@ªí1").Range("A1")
  7.     row = 2
  8.     Do While rg(row) <> ""
  9.          If rg(row) > 0 And rg(row, 2) < 0 Then ng = ng + 1
  10.         row = row + 1
  11.     Loop
  12.     If ng <> 0 Then
  13.         MsgBox "¦³ : " & ng & " µ§" & "­t¼Æ!!!  ", vbExclamation, "  Äµ  ¥Ü "
  14.     Else
  15.         MsgBox "¨S¦³­tªº", vbOKOnly, " "
  16.     End If
  17. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# stillfish00
   
½Ð±Ð±z­Y¦bAÄæ½s¸¹¦³1234&-1234
¦p¹Ï:
1.png
½s¸¹¥h±¼«e­±¦³" - "¤£­pºâ
¥u­pºâ¥¿±`ªº1234.1555.1556.1777.1899.1890.9999.9997³o¨Ç½s¸¹§Y¥i
-1234.-1890©¿²¤¤£¬Ý

¥H¤U¬O­×§ïªºµ{¦¡½X¦ýµ²ªG¤£¬O¥¿½Tªº
  1. Sub CNN()
  2. Dim ng As Integer
  3. Dim rg  As Range
  4. Dim row As Long
  5. Set rg = Worksheets("¤u§@ªí1").Range("A1")
  6. row = 2
  7. Do While LEFT(rg(row, 1),1) <> "-"
  8. ng = Evaluate("COUNTIF(B:B,""<0"")")
  9. row = row + 1
  10.   Loop
  11. If ng <> 0 Then
  12. MsgBox "¦³ : " & ng & " µ§" & "­t¼Æ!!!  ", vbExclamation, "  Äµ  ¥Ü "
  13. Else
  14. MsgBox "¨S¦³­tªº", vbOKOnly, " "
  15. End If
  16. End Sub
½Æ»s¥N½X
µ²ªG·|¶]¥X¤Tµ§­t¼Æ
¦ý¥¿½Tµ²ªG¬O¥u¦³¤@µ§
³o¼Ëµ{¦¡½X¸Ó«ç»ò­×§ï~

TOP

¦^´_ 4# stillfish00


    ÁÂÁ±zªº¸Ô²Ó¸Ñ»¡~
    ¾Ç¨ì¤F¤@½Ò:)

TOP

¦^´_ 3# Changbanana
³oÃäEvaluate³æ¯Â¬O­pºâ¤½¦¡«á¶Ç¦^µ²ªG¡A°Ñ¼Æ¥²¶·¬O¦r¦ê
¤]¥i¥H¼g¦¨¤¤¬A¸¹¡A¦p
ng = [COUNTIF(A:A,"<0")]
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 2# stillfish00
ÁÂÁ§A~ ¦¨¥\¸Ñ¨M¡A¤£¥Î¦b¯S©wÀx¦s®æ¤U¤½¦¡¤F

Evaluate ªº¥Îªk¬O?
¥i§_¸Ñ»¡¤@¤U~

TOP

¦^´_ 1# Changbanana
ng = Evaluate("COUNTIF(A:A,""<0"")")
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ¤£­n¤p¬Ý¦Û¤v¡A¦]¬°¤H¦³µL­­ªº¥i¯à¡C
ªð¦^¦Cªí ¤W¤@¥DÃD