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

[µo°Ý] ¦p¦ó¿ï¨ú¨C¦¸Äæ¦ì³£·|Åܪº¸ê®Æ½d³ò©O?¥ÎfindÁÙ¬OInStr?ÁÙ¬O§Oªº??

[µo°Ý] ¦p¦ó¿ï¨ú¨C¦¸Äæ¦ì³£·|Åܪº¸ê®Æ½d³ò©O?¥ÎfindÁÙ¬OInStr?ÁÙ¬O§Oªº??

°ÝÃD: ¦b°µ¸ê®Æ¶×¾ã®É,¨C¦¸¸ê®Æ¨Óªº®É­Ô,¥Ø¼Ð¸ê®Æ©ÒÄÝÄæ¦ì³£¤£©w,(µLªk©w¸q¦WºÙ)
­n¥Î¤°»ò»yªk¬d¸ßÄæ¦ì¦W¨Ó¿ï¨ú¥Ø¼ÐÄæ¦ì¤Uªº¸ê®Æ©O???¦A½ÐÀ°¦£...·Q¦n¤[,·Q¤£¥X¨Ó >///<

´y­z:
1) ­n±Nsheet1ªºÂŦâ¤Î¶À¦â³¡¤À¸ê®Æ ½Æ»s¨ì sheet2
2) ÂŦⳡ¤À¸ê®ÆÄæ¦ì©T©w,³£¬OB:D¦C
3) ¶À¦â³¡¤À¸ê®ÆÄæ¦ì¤£©T©w,¨C¦¸¨Ó³£¦³¥i¯à·|¤£¤@¼Ë...
  -> ­n¥Î¤°»ò»yªk,¨Ó¬d¸ßÄæ¦ì¦WºÙ"¨Mij"©Î"½æ»ù",¶i¦Ó¨D¨ì¶À¦â³¡¤ÀªºRANGE ¦ì¸m©O?


Sub TEST()
   Worksheets(1).Activate '¶}啓sheet1
   Range("B9:D9", Range("B9:D9").End(xlDown)).Select '¿ï¾ÜÂŦâ°Ï¶ô
   Selection.Copy  '½Æ»s¿ï¾Ü°Ï¶ô
   Worksheets(2).Activate  '¨ìsheet2
   Range("B65536").End(xlUp).Offset(1).PasteSpecial Paste:=xlValue, operation:=xlNone  '¶K¨ìsheet2,BÄæ±µ¤U¥hªÅ¥Õ¦ì¸m
   Worksheets(1).Activate '¶}啓sheet1
   '¦p¦ó¿ï¨ú¶À¦â³¡¤À?­n¥Î'FIND'ÁÙ¬O'InStr'¥H¨D±o¶À¦â³¡¤Àrange¦ì¸m?¦p¦ó¥Î¤~¦n©O???
End Sub

¦^´_ 1# vickey99
  1. Sub TEST()
  2. Dim Rng As Range, A As Range, r&
  3. With Sheet1
  4. Set Rng = .Range("B9:D9", .Range("B9:D9").End(xlDown))
  5. r = Rng.Rows.Count
  6. Set A = Sheet2.[B65536].End(xlUp)
  7. A.Offset(1).Resize(r, 3) = Rng.Value
  8. A.Offset(1, 3).Resize(r, 3) = .[N9].Resize(r, 3).Value
  9. End With
  10. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

«D±`·PÁª©¤jªº¦^ÂÐ,¤pªº¤~²¨¾Ç²L,
¬Oªì¾ÇªÌ,¦³¨Ç¤£À´ r ªº³¡¤À,
r ¬O¨D¦æ¼Æ¶Ü?  r = Rng.Rows.Count

¥t¥~ ¦]¶À¦â³¡¤À¸ê®Æ·|ÅÜ°Ê,¦p¦ó¨D¥X¶À¦â°Ï¶ô°_©l¦ì¸m[N9]©O?
¦]¬°¤U¦¸¸ê®Æ¨Ó,¶À¦â°Ï¶ô°_©l¦ì¸m[N9]¦³¥i¯à´N¤£¬O[N9]¤F..
¦A½Ð½ç±Ð,¤pªº·P¿E¤£ºÉ~

TOP

¦^´_ 3# vickey99


   
¥t¥~ ¦]¶À¦â³¡¤À¸ê®Æ·|ÅÜ°Ê,¦p¦ó¨D¥X¶À¦â°Ï¶ô°_©l¦ì¸m[N9]©O?

·|ÅÜ°ÊÄæÁÙ¬O¦C?Åܰʪº¨Ì¾Ú¬O¤°»ò?
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

dear ª©¤j,

  ¨þ~ª©¤jªGµM¥\¤O²`«p,¤pªº¬ã¨s¥b¤Ñ²×©ó¤F¸Ñ­ì¨Ó r¬O¨Drngªº¦C¼Æ°Ú~
¦]¸ê®Æ¨Ó·½ªº¶µ¥Ø¦WºÙ"¨Mij";©Î"½æ»ù"ªºÄæ¦ì¨C¦¸¥i¯à³£·|ÅÜ,¥i¯à¬ONÄæ ©Î SÄæµ¥¤£©w..
¬ãŪ°Q½×°Ï¨ä¥L¸ê®Æ«á,¥ý¥Îfind¨Ó§ä"¨Mij",¦Aoffset§ä¥Ø¼Ð¸ê®ÆRange,
¦ý¦Û¤v¸Õªºµ²ªG¦³bug...¯u¤£ª¾¬O­þ¸Ì¿ù¤F >///<
¦A½Ð«ü±Ð,·P¿E¤£ºÉ~


Sub TEST2()
Windows("12072602_Sample.xls").Activate
Dim A As Range, B As Range, C As Range, r&
With Sheet1
Set A = .Range("B9:D9", .Range("B9:D9").End(xlDown))
r = A.Rows.Count
Set B = .Range("5:5").Find("¨Mij", LookAt:=xlPart).Offset(4, 0).Resize(r, 3)
Set C = Sheet2.[B65536].End(xlUp)
C.Offset(1).Resize(r, 3) = A.Value
C.Offset(1, 3).Rezize(r, 3) = B.Value
End With
End Sub
12072602_Sample.rar (51.57 KB)

TOP

¦^´_ 5# vickey99

C.Offset(1, 3).Resize(r, 3) = B.Value
   Àˬd¬õ¦r
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# Hsieh


    ¨þ¨þ..:$  ¿ù¦b¤£¸Ó¿ùªº¦a¤è...¯uêÉ°Ú~
·PÁª©¤j¤£§[«ü±Ð,±N»yªk¼gªºÂ²¼ä¦³¤O~
¤pªº¨ü¯q¨}¦h~vba¯u¬O¦³½ì°Ú~
ÁÂÁ±z^^

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD