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

°j°é½Ð¯q¡A¨Ï¥ÎFor Next³¯­z¦¡¡G­Yb¦³­È«ha«Ø¥ßx

°j°é½Ð¯q¡A¨Ï¥ÎFor Next³¯­z¦¡¡G­Yb¦³­È«ha«Ø¥ßx

·j´M¤F°j°é©R¥Oªº±Ð¾Ç©M°Q½×¡AÁÙ¬O¤£¤Ó©úÁA¦p¦ó¨Ï¥Î
·Q½Ð±Ð¦U¦ì«e½ú­Ì
­Y
B6:B43,B59:B96
¦³¦r¤¸¡A«h°õ¦æ¥¨¶°«á¡A¦b¥ª¤èAÄæ¦ì¦Û°Ê¿é¤J"x"¦r¸¹
°j°é½d¨Ò.rar (15.2 KB)

¦^´_ 1# jackson7015
  1. Sub xx()
  2. For Each B In Union([B6:B43], [B59:B96])
  3.   If B <> "" Then B.Offset(, -1) = "x"
  4. Next
  5. End Sub
½Æ»s¥N½X

TOP

  1. Sub YY()
  2. For Each C In [B:B].SpecialCells(2)
  3. C(1, 0) = "X"
  4. Next
  5. End Sub
½Æ»s¥N½X
³o¼Ë¥iÁקK´`Àô¨ìªÅ¥ÕÀx¦s®æ

TOP

¦^´_ 3# oobird


    ½Ð°Ý¤@¤U, µ{¦¡¤¤ ªº  C ÅܼÆ, ¬O Range ª«¥ó¶Ü?

TOP

·íµM¬O¡C
§A¥i¥H¥ÎMsgBox TypeName(c)
±oª¾ÅܼÆÃþ«¬

TOP

¦^´_ 4# alumi
   Dim C As Variant    ¤@ ¯ë°j°é Åܼƥi³]¬° Variant ¨S³Q©ú½T«Å§i¬°¨ä¥L«¬ºA (¥i¥H¬°¥ô¦ó«¬ºA)
  1. Sub Ex()
  2.     [B:B].SpecialCells(xlCellTypeConstants).Offset(, -1) = "X"
  3.    ' [B:B].SpecialCells(2).Offset(, -1) = "X"   '  ¦P¤W  xlCellTypeConstants °Ñ¼Æªº­È=2
  4. End Sub
  5. Sub YY()
  6.     Dim C As Variant  
  7.     For Each C In [B:B].SpecialCells(2)
  8.         C(1, 0) = "X"
  9.       ' MsgBox TypeName(C)
  10.     Next
  11.     MsgBox TypeName(C)
  12. End Sub
  13. Sub YY_A()
  14.     Dim C As Range
  15.     For Each C In [B:B].SpecialCells(2)
  16.         C(1, 0) = "X"
  17.     '    MsgBox TypeName(C)
  18.     Next
  19.     MsgBox TypeName(C)
  20. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ alumi ©ó 2012-5-18 23:25 ½s¿è
·íµM¬O¡C
§A¥i¥H¥ÎMsgBox TypeName(c)
±oª¾ÅܼÆÃþ«¬
oobird µoªí©ó 2012-5-18 15:03

  
   

    ÁÂÁÂ~~GBKEE

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD