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

[µo°Ý] [µo°Ý] VBA¶ñ¤J¤½¦¡

[µo°Ý] [µo°Ý] VBA¶ñ¤J¤½¦¡

½Ð±Ð¤@¤U  
§Ú·Q¦bBÄæ´£¨úAÄæ¸ê®Æªº¥ªÃä¤T¦ì¦r¤¸¡A
¸ê®ÆÀɦ³®É­Ô´X¦Ê¦æ,¦³®É­Ô·| 2¤d¦h¦æ ,
·Q¨Ï¥ÎVBA ¦bBÄæ¶ñ¤J¤½¦¡¡A­n¦p¦ó¼g ?

VBA¼g¤J¤½¦¡.png (37.65 KB)

VBA¼g¤J¤½¦¡.png

¦^´_ 11# Scott090


    ·PÁÂScott¤j!

   ¨C¤@­Ó¤u§@­¶ªº®æ¦¡³£¤@¼Ë¡A §Ú¨Ó¸Õ¤@¤Uµ{¦¡¡A¦A§âÀɮ׸ɶK¤W¨Ó!

TOP

¦^´_ 10# n7822123


ÁÂÁªüÀs¤j!
§Ú¬O¨C©P·|¦³¤@­ÓExcel ¸ê®ÆÀɲ£¥Í¡A ­n°µ²Î­p¤ÀªR¤@¦~ªº¸ê®Æ¡A
§Ú¥Ø«eªº°µªk¬O¥Î¤@­Ó¤u§@ï¥ÎVBA¶×¤J52¶gªº¸ê®Æ«Ø¦¨52¤u§@­¶¡A¦b¨C­¶¶×¤J§¹¦¨®É¶¶«K¶ñ¤J¤½¦¡°µ¥X¦U¦Cªº©ÒÄÝÃþ§O¥H«K²Î­p¡C
§Ú¥ý¸m¤JªüÀs¤jªºµ{¦¡¶]¶]¬Ý¡A¦A§âÀÉ®×PO¤W¨Ó!

TOP

¦^´_ 10# n7822123


    ÁÂÁ¡A§Ú¾Ç²ß¤F³o¤@©Û¡G
         "¥ÎVBA¼g¨ç¼Æ´N§ó²³æ¤F¡A¤£¥Î°j°é¡A¤@¦æ¸Ñ¨M
           ¨ç¼Æ¸ÌªºA2·|¦Û°ÊÅܧó¬°A3,A4,A5"

      §Ú´¿¸g¦b¨ä¥L¦a¤è¼gªº¼Ò¦¡¬O§â¦C ¥Î i ·íÅܼơG
         .Cells(i, "B").Formula = "=LEFT(A" & i & ",3)"

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-12-7 00:20 ½s¿è

¦^´_ 8# Scott090


³á³á¡A¨Sª`·N¨ì²Ä¤@¦C¬O¼ÐÃD¦C
¥ÎVBA¼g¨ç¼Æ´N§ó²³æ¤F¡A¤£¥Î°j°é¡A¤@¦æ¸Ñ¨M
¨ç¼Æ¸ÌªºA2·|¦Û°ÊÅܧó¬°A3,A4,A5

[B2].Resize([A1].End(4).Row-1) = "=LEFT(A2,3)"
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 1# ABK


    ¦b B Äd¶ñ¤J¤½¦¡¡G

    cells(2,"B").formula = "= LEFT(A2,3)"
    cells(3,"B").formula = "= LEFT(A3,3)"

TOP

¦^´_ 7# n7822123


    °²³]¤u§@鷺¨C­Ó¤u§@ªíªº®æ¦¡³£¤@¼Ë
    ¥B¤u§@ªíªº²Ä¤@¦C¬OÄæ¦ì¦WºÙ
    Sub test()
      Dim Arr, sh
      For Each sh In Sheets
            With sh
                  Arr = Range(.[A2], .[A1].Cells(.Rows.Count, 1).End(3))
                  For i = 1 To UBound(Arr): Arr(i, 1) = Left(Arr(i, 1), 3): Next
                  .[B2].Resize(UBound(Arr)) = Arr
            End With
      Next
   End Sub

  ³o¼Ë¤]³\¥i¥H«Ü§Ö§â40´X­Ó¤u§@ªí°µ§¹

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-12-5 13:41 ½s¿è

¦^´_ 6# Scott090


scotto90 ¤j¤j©Ò¨¥§Y¬O¡A¥Î°}¦C·|¤ñ¸û§Ö¡A
¦]¬°ª©¤j¨S¦³´£¨ÑÀɮסA©Ò¥H§Ú´N¥u¼g¤@­ÓsheetªºVBA°µ¬°°Ñ¦Ò

Sub test()
Dim Arr, i%
Arr = Range([A1], Cells(Rows.Count, 1).End(3))
For i = 1 To UBound(Arr): Arr(i, 1) = Left(Arr(i, 1), 3): Next
[B1].Resize(UBound(Arr)) = Arr
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 4# ABK


    ¥Î°}¦C³B²zÀ³¸Ó·|¤ñ¨C­ÓÀx¦s®æ¤À§O³B²z¨Ó±o§Ö

TOP

¦^´_ 4# ABK


40­Ósheet ¨C­Ósheetºâ2000µ§¡A¤]¤~8¸Uµ§¸ê®Æ§r

VBA¼gªº¦nÀ³¸Ó¤£»Ý­n¤Ó¤[¤~¬O¡A¼g¨ç¼Æ«OÃÒ§óºC¡A§ó¥d
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD