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

[µo°Ý] ½Ð±Ð»yªk¬O­þ¸Ì¥X°ÝÃD¡H

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-30 07:01 ½s¿è

¦^´_ 15# skyutm
³o¨ÇÅÜ¼Æ a11 , b11, c11, d11, e11, f11    Dim   As Integer  µ{§Ç©|¥¼µ¹­È®É ³£¬° 0     
³o¦¡¬O¦h¦¹¤@Á|  a11 = b11 = c11 = d11 = e11 = f11 = 0   ¶Ç¦^   True ©Î False   (++=+ ,  +-=- , --=+)
  1. Option Explicit
  2. Sub Ex()
  3. Dim xlBoolean As Boolean
  4. Dim a11 As Integer, b11 As Integer, c11 As Integer, d11 As Integer, e11 As Integer, f11 As Integer
  5. a11 = b11
  6. xlBoolean = a11
  7. Debug.Print xlBoolean & " " & a11 '§Y®É¹Bºâµøµ¡²×¥i¹î¬Ý
  8. a11 = b11 = c11
  9. xlBoolean = a11
  10. Debug.Print xlBoolean & " " & a11
  11. a11 = b11 = c11 = d11
  12. xlBoolean = a11
  13. Debug.Print xlBoolean & " " & a11
  14. a11 = b11 = c11 = d11 = e11
  15. xlBoolean = a11
  16. Debug.Print xlBoolean & " " & a11
  17. a11 = b11 = c11 = d11 = e11 = f11
  18. xlBoolean = a11
  19. Debug.Print xlBoolean & " " & a11
  20. a11 = b11 = c11 = d11 = e11 = f11 = 0
  21. xlBoolean = a11
  22. Debug.Print xlBoolean & " " & a11
  23. End Sub
½Æ»s¥N½X

Boolean ¸ê®Æ«¬ºABoolean ÅܼƫY¥H 16 ¦ì¤¸( 2 ­Ó¦ì¤¸²Õ)¼Æ¦rªº§Î¦¡Àx¦s¡A¦ý¥u¯à¬O True ©Î¬O False¡CBoolean Åܼƪº­È¤£¬O True ´N¬O False ( ¦b¨Ï¥Î Print ªº®É­Ô )¡A©Î¬O #TRUE# ©M #FALSE# ( ¦b¨Ï¥Î Write # ªº®É­Ô )¡C¨Ï¥ÎÃöÁä¦r True »P False ¥i±N Boolean Åܼƫü©w¬°³o¨â­Óª¬ºA¤¤ªº¤@­Ó¡C
·íÂà´«¨ä¥Lªº¼Æ­È«¬ºA¬° Boolean ®É¡A0 ·|Âন False¡A¦Ó©Ò¦³¨ä¥Lªº­È«hÅܦ¨ True¡C·íÂà´« Boolean ­È¬°¨ä¥Lªº¸ê®Æ«¬ºA,®É¡AFalse ¦¨¬° 0 ¡A¦Ó True ¦¨¬° -1¡C

TOP

©êºp¡I§Ú¤S¨Ó¥´ÂZ¤F¡C¤W¦¸¦³°Q½×¹L¡C¦ý¬O³o¤@¦¸¦³°µ­×¥¿¡A«o¥X²{°ÝÃD
»yªk¦p¤U¡G
    Dim  ...
skyutm µoªí©ó 2012-8-29 23:48


¸g´ú¸Õªºµ²ªG,
­Y°õ¦æ¹L a11 = b11 = c11 = d11 = e11 = f11 = 0 ¥H«á,
a11 ©T©w·|³Q§ï¦¨ -1
§Ú²q¦³¥i¯à¬O¸Ó«ü¥O³Q¸Ñ´·¦¨ :
a11= (a11 = 0) (¤¤¶¡ªº«ü¥O³£³Qª½±µ©¿²¤±¼¤F)
·|³o¼Ë§PÂ_¬O¦]¬°¤W¦¡­Y§ï¬° = 1 ©Î = 5 ®É,
a11 ³£·| = 0
¦Ó­YÅܧ󤤶¡°Ñ¼Æ¦WºÙ«h¨º¨Ç°Ñ¼Æ­È³£¤£·|ÅÜ. (µM¦Ó­Y¦³«D¨Æ¥ý©w¸qªº°Ñ¼Æ¦WºÙ¥X²{,«h·|·s¼W¸Ó°Ñ¼Æ¥X¨Ó)

°½Ãiªº¤èªk¬O¦b¸Ó¦æ«á¦A¥[¤W¤@­Ó :
a11 = 0

©Î¬O±N¸Ó¦æ§ï¦¨ :
a11 = 0 : b11 = 0 : c11 = 0 : d11 = 0 : e11 = 0 : f11 = 0

¨ä¹ê¤£¶]¸Ó¦æ¤]¬O¥i¥Hªº,
¦]¬°¾ã¼Æ©ó Dim «áªì­È¥»¨Ó´N¬O 0

C ªº»yªk¦³¨Ç¬O¤£¯à¦b Basic ¤W¥Îªº,
¦]¬°¥i¯à·|³y¦¨«D§Ú­Ì©Ò¹w´Áªºµ²ªG.

TOP

¦^´_ 13# GBKEE
©êºp¡I§Ú¤S¨Ó¥´ÂZ¤F¡C¤W¦¸¦³°Q½×¹L¡C¦ý¬O³o¤@¦¸¦³°µ­×¥¿¡A«o¥X²{°ÝÃD
»yªk¦p¤U¡G
    Dim a11 As Integer, b11 As Integer, c11 As Integer, d11 As Integer, e11 As Integer, f11 As Integer, x11 As Integer
    a11 = b11 = c11 = d11 = e11 = f11 = 0
    myrowcount = Sheets("°ò¥»³]©w").Range("j3").Value + 5
    For x11 = 6 To myrowcount
    Set myrange = Sheets("´Á¤¤¦¨ÁZ").Range("c" & x11)
    Select Case myrange
        Case 100
            a11 = a11 + 1
        Case 90 To 99
            b11 = b11 + 1
        Case 80 To 89
            c11 = c11 + 1
        Case 70 To 79
            d11 = d11 + 1
        Case 60 To 69
            e11 = e11 + 1
        Case 0 To 59
            f11 = f11 + 1
    End Select
    Next x11
    Sheets("´Á¤¤¦¨ÁZ").Range("c108").Value = a11
    Sheets("´Á¤¤¦¨ÁZ").Range("c109").Value = b11
    Sheets("´Á¤¤¦¨ÁZ").Range("c110").Value = c11
    Sheets("´Á¤¤¦¨ÁZ").Range("c111").Value = d11
    Sheets("´Á¤¤¦¨ÁZ").Range("c112").Value = e11
    Sheets("´Á¤¤¦¨ÁZ").Range("c113").Value = f11
­×¥¿ªº¦a¤è¡A¬O§â0~9 10~19 20~29 30~39 40~49 50~59 ¥þ³¡§ï¦¨0~59 ¡A°ÝÃD¦b©óÅã¥Ü100¦³´X¤Hªº¦a¤è·|¥X²{-1

TOP

¦^´_ 13# GBKEE
·PÁª©¥D¤j¤j¡A§Ú¤S¾Ç¨ì¤F¤@½Ò¡C­ì¨Ó¥u¬O¤@­ÓªÅ®æ¤§®t¡C±q¾Ç²ßvba¥H¨Ó¡A§Úªº¤ß±o´N¬O¡G§O¤H¼gªº¤£ºâ¡A¦Û¤v­n¸Õ¹L¤~ª¾¹D¡A·íÀY¸£¥´µ²®É¡A´N­n»°§Ö°Ý¤H¡A¤£µM·|­ì¦a¥´Âà¡I

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-29 06:35 ½s¿è

¦^´_ 12# skyutm
& ¹Bºâ¤l»P«e«áªº¦r¦ê©ÎÅܼƶ·ªÅ¤@®æ
&»P«e­±³s±µªº¦r¦ê©ÎÅܼƪŤ@®æ , ¨t²Î·|¦Û°Ê¦b&«áªÅ¤@®æ
A= B &C                 ¨t²Î·|¦Û°Ê¦b&«áªÅ¤@®æ    A= B & C
A=B &C &D &E   ¨t²Î·|¥u·| ¦b&«áªÅ¤@®æ    A= B & C & D & E

TOP

¦^´_ 11# skyutm
°ÝÃD¤S¨Ó¤F¡A¤S¦³¤@­Ó¸Ñ¤£¶}ªº°ÝÃD¡A¦b¨q¥X¤¤¤å¦r®É¡A¬O¤£¬O¦b¤¤¤å¥[¤W""´N¥i¥H¤F¡AµM«á¥[¤W&´N¥i¥H³sµ²ÅܼơA³sµ²¤@­ÓÅܼƨS°ÝÃD¡A¥i¬O§Ú­n¦A¥[²Ä¤G­ÓÅܼƮɡA´NÅã¥Ü»yªk¿ù»~¡H¤£À´¡A·Ð½Ð¸Ñ´b¡A¤£³Ó·P¿E¡I¡]§Ú·Q¨q¥X¡H¦~¡H¯Z¡^

    '´Á¤¤¦¨ÁZ¼ÐÃD'
    Dim a1, a2
    a1 = Sheets("°ò¥»³]©w").Range("j1").Value
    a2 = Sheets("°ò¥»³]©w").Range("j2").Value
    With Sheets("´Á¤¤¦¨ÁZ")
    .Range("b2").Value = "·s¸ô°ê¥Á¤p¾Ç" & a1&"¦~"

TOP

¦^´_ 10# GBKEE
·PÁª©¥D¡A§Ú¤S¾Ç¤F¤@½Ò¡C

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-27 06:04 ½s¿è

¦^´_ 9# skyutm
Dim  ÅܼƠ As  «¬ºA(©Î ª«¥ó)   (¨S¦³«ü©ú´N¬O  Variants«¬ºA)
¨Ã«D©Ò¦³¤u§@ªí¨ç¼Æ¬Ò¥i¥Î©óVBA
¹Ï¤¤¥i¿ï¥ÎV BA¥i¥Î¤§¤u§@ªí¨ç¼Æ



¤W¹Ï ¶·¦³¦¹³]©w

TOP

¦^´_ 8# GBKEE
­ì¨Óª©¥D¤]¬O¦­°_ªº³¾¨à¡A¦A¦¸·PÁ¡C¤£¹L¤p§ÌÁÙ¬O¦³¨ÇºÃ°Ý·Q´£¥X¡G1.dim chall,aa ³o¨à¬O¤£¬O¬Ù²¤¤F¤°»ò¡H®Ñ¤W»¡­n©w¸qÅܼÆ2.application«á­±©Ò¥[ªº¨ç¼Æ¬O¤£¬Oexcel¤u§@ªí¨Ï¥Îªº¨ç¼Æ¡H

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-26 06:22 ½s¿è

¦^´_ 1# skyutm
SpecialCells(xlCellTypeConstants, xlNumbers)  ¨S¦³¶Ç¦^«ü©wªºÀx¦s®æ·|¦³¿ù»~
¤u§@ªí¨ç¼Æ Count  :­pºâ§t¦³¼Æ¦rªºÀx¦s®æ¼Æ¶q
¤u§@ªí¨ç¼Æ CountA :­pºâ¤£¬OªÅ¥ÕªºÀx¦s®æ¼Æ¶q
  1. Sub Ex()
  2. Dim chall, aa
  3. chall = Worksheets("°ò¥»³]©w").Range("d2").Value
  4. With Worksheets("´Á¤¤µû¶q")
  5. .Range("c2").Value = "°ê»yx" & chall
  6. aa = Application.Count(.Range("c3", .Range("c3").End(xlDown)))
  7. End With
  8. Worksheets("´Á¤¤²Î­p").Range("d4").Value = aa
  9. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡µLªk¾B¾×¡j©È®É¶¡®ø³u¡Aªá¤F³\¦h¤ß¦å¡A·QºÉ¦U¦¡¤èªk­n¾B¾×®É¶¡¡Aµ²ªG¬O¡G®ö¶O¤F§ó¦h®É¶¡¡A¥B¤@µL©Ò¦¨¡I
ªð¦^¦Cªí ¤W¤@¥DÃD