ªð¦^¦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

¸Õ¸Õ

Sub TEST()
Sheet1.[B2:B65536].ClearContents
X = Sheet1.[A65536].End(xlUp).Row
Y = Sheet1.[B65536].End(xlUp).Row
  For M = 2 To X
   Sheet1.Cells(Y + 1, 2) = Mid(Sheet1.Cells(M, 1), 1, 3)
   Y = Y + 1
  Next
End Sub
ù

TOP

¦^´_ 2# rouber590324


    ·PÁÂRouber¤j !

TOP

°£¤F°j°é ÁÙ¨ä¥Lªº¤èªk¶Ü?
¤@­Ó¤u§@ï ¦³®É­Ô­n¶] 40¦h­ÓSheet¡A ¨C¤@­ÓSheet ³£¦³¤@¨â¤d¦æ¸ê®Æ¡A
¥Î°j°é¶]­n¯Ó¤@¨Ç®É¶¡ !

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

¦^´_ 4# ABK


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

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

¦^´_ 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

¦^´_ 1# ABK


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

    cells(2,"B").formula = "= LEFT(A2,3)"
    cells(3,"B").formula = "= LEFT(A3,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

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