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

[µo°Ý] ½Ð±Ðª«¥óÅܼƪº»yªkset»Pwith-end with

[µo°Ý] ½Ð±Ðª«¥óÅܼƪº»yªkset»Pwith-end with

¥»©«³Ì«á¥Ñ oak0723-1 ©ó 2010-9-6 23:34 ½s¿è

½Ð°Ý
With Sheets("1")
rng = .Range(.[c10], .[m83].End(3))
End With
rng¬Oª«¥óÅܼÆ
¥i§_±Nwith-enwith§ï¼g¦¨
set rng = Sheets("1").Range(Sheets("1").[c10], Sheets("1").[m83].End(3))

set rng = Sheets("1").Range(Sheets("1").[c10], Sheets("1").[m83].End(3))¬O¹ïªº
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

set rng = Sheets("1").Range(Sheets("1").[c10], Sheets("1").[m83].End(3))
³o¼Ë¬O§ârng©w¸q¬°rangeª«¥ó(¹ï¶H)
»P«e­±©w¸q¦¨°}¦C¦b®Ä¯à¤W¤£¯à¦P¤é¦Ó»y¡I

TOP

¥»©«³Ì«á¥Ñ oak0723-1 ©ó 2010-9-7 00:11 ½s¿è

¦^´_ 3# oobird


    ©Ò¥H®t§O¦b®Ä¯àÅo??
With Sheets("1")
rng = .Range(.[c10], .[m83].End(3))
End With
³o¼Ë¼gªk¤S¬O§ârng©w¸q¦b­þ¸Ì?

TOP

³o¼Ërng¬O¤@­Ó2ºû°}¦C¡A¨S¦³Àx¦s®æ¨ä¥L¸ê°T¡A¥u¦³­È¡C¦s¦b°O¾ÐÅ餤¡Aµ{¦¡µ²§ô«á§Y®ø¥¢¡C

TOP

¦^´_ 5# oobird

ÁÙ¬O¤£¬O«ÜÀ´~~~
¼gªk1>
With Sheets("1")
rng = .Range(.[c10], .[m83].End(3))
End With
¼gªk2>
set rng = Sheets("1").Range(Sheets("1").[c10], Sheets("1").[m83].End(3))
2­Ó¼gªk³£¥¿½T
³£¥i°õ¦æ
®t§O¦b©ó°õ¦æ®Ä²v
¦ý¬O¦¹®É¼gªk1¸û¼gªk2¦³°õ¦æ®Ä²v
¦]¬°¼gªk2µ¥©ó±NÅܼÆrng³]©wµ¹ª«¥órange´NÅܦ¨
rng¦¨¤FÄÝ©órangeªºª«¥óÅܼÆ
¥i¬O¤p§Ì©Ò¬Ýªº®Ñ¦³Â²³æ´£¨ì
¨Ï¥Îwith-with end¬O¬°¤F³]©w¬Y¤@ª«¥óªº¦h¶µÄÝ©Ê
°ÝÃD:
With Sheets("1")
rng = .Range(.[c10], .[m83].End(3))
End With
¦b³o­Ó¶¥¬q
ÅܼÆrng¬O¤°»ò©Ê½èªºÅܼÆ?
¬O¤u§@ªíSheets("1")ªºª«¥óÅܼƶÜ?

TOP

1.¥ý¤F¸Ñwith
¨Ï¥Îwith¥i´î¤Ö¹ïÀx¦s®æªºÀWÁc¦s¨ú¡C§ó¥i¥HÁYµuµ{¦¡½X¡A¥H¦¹¨Ò¨Ï¥Îwith«á
­ì¥»rng = Sheets("1").Range(Sheets("1").[c10], Sheets("1").[m83].End(3))
´N²¤Æ¦¨rng = .Range(.[c10], .[m83].End(3))
2.«e­±»¡¤F¬O§â³o­Ó½d³òªº¸ê®Æ¥H¤Gºû°}¦C¦s©ñ¦b°O¾ÐÅ餺¡A¤£¦A¬OÀx¦s®æ¤F¡A¦Ó¬O¯Â¯Üªº¸ê®Æ±Æ¦C¡CÄÝVariant«¬ºA¡A¦]exceÅܼÆl¹w³]­È¬OVariant¡A©Ò¥H¤£¥Î¼g¥X¨Ó¡C

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2010-9-7 21:57 ½s¿è

¦^´_ 6# oak0723-1

§A§âµ{¦¡¬Ý½ÆÂø¤F,
¨ä¹êÂk®Úµ²©³´N¥u¦³¨â­Ó³¡¥÷ :
1.  ¦b With A  »P End With ¤¤¶¡ªº±Ô­z¸Ì, ¥H "." ¶}ÀYªº±Ô­z¤@«ßµ¥¦P "A.", ¥ç§Y
With Sheets("1")
  rng = ¡ERange(¡E[c10], ¡E[m83].End(3))
End With

·|µ¥¦P©ó

rng = Sheets("1")¡ERange(Sheets("1")¡E[c10], Sheets("1")¡E[m83].End(3))

µù : ¤W¨Ò¤¤ ¬°¨D®ÄªG©úÅã¤@«ß¥H "¡E" ¥Nªí "."

2. ¦b±Ô­z¤¤ rng ªº«e¤è¨Ã¨S¦³ "." ,
©Ò¥H¥¦»P Sheets("1") ¨Ã¨S¦³ª½±µªº¨Ì¦sÃö«Y.

¦Ó¦]¬°¥¦¥kÃäµ¥¸¹ªº¥k¤è¬O ".RANGE()" §Î¦¡ªº±Ô­z,
©Ò¥H¥¦ªº¤º§t¬° Sheets("1") ¤¤¬Y­Ó RANGE½d³ò ªº¤º§t­È,
¥ç§Y¬O "¦h­Ó" (°£¤F Range ¥u¦³¤@­ÓÀx¦s®æ¥H¥~)­È ²Õ¦¨ªº¸ê®Æ,
©Ò¥H³Ì¦³¥i¯àÀx¦s¥¦(­Ì)ªºÀ³¸Ó·|¬O¤@­Ó "°}¦C".

TOP

¦^´_ 8# luhpro


    ¤j­P¤F¸Ñ~~~
·P®¦³á

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD