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

[µo°Ý] ½Ð±Ð ¤å¦rÃþ«¬¼Æ¦r»¼¥[°ÝÃD

[µo°Ý] ½Ð±Ð ¤å¦rÃþ«¬¼Æ¦r»¼¥[°ÝÃD

¤p§Ì¦³­Ó°ÝÃD½Ð±Ð §Ú¦³¨â­Ó¼Æ¦r(¤å¦rÃþ«¬) ­n¨ú¤¤¶¡ªº­È
Á|¨Ò:005660~005999  ­n¦C¥X¨Ó:005560¡A005561¡A005562¡A....005998¡A005999
  1. Sub test()

  2. Dim ws As Excel.Worksheet
  3. Set ws = ThisWorkbook.Worksheets(1)
  4.         
  5. Dim strStart As String
  6. Dim strEnd As String

  7. strStart = ws.Cells(1, 1)
  8. strEnd = ws.Cells(2, 1)

  9. 'strStart  = 005560
  10. 'strEnd = 005999

  11. I = 1

  12. For Y = strStart To strEnd
  13. ws.Cells(I, 2) = Trim(Y)
  14. I = I + 1
  15. Next Y

  16. End Sub
½Æ»s¥N½X
¦ý¬O¶]¥X¨Ó³£¬O5560¡A5561¡A5562¡A....5998¡A5999
·Q½Ð±Ð¦U¦ì¤j¤j¥i§_«ü¾É»Ý­n­×§ï¨º³¡¤À©O?

¦^´_ 1# yunshiow
§A­nª¾¹D§AªºFor°j°é¤¤¡AyÁÙ¬O¼Æ¦r
¨âºØ¤èªk¡A¬Ý§AÀx¦s®æ¤º¬O­n©ñ¤å¦rÁÙ¬O¼Æ¦r
1.
  1.     ws.Cells(i, 2).NumberFormat = "@"   'Àx¦s®æ®æ¦¡§ï¤å¦r
  2.     ws.Cells(i, 2) = Format(y, "000000")  '¼Æ¦rÂন¤å¦r¡A¥¼º¡¤»¦ì¼Æ«e­±¸É¹s
½Æ»s¥N½X
2.
  1.     ws.Cells(i, 2).NumberFormat = "000000"  '­×§ïÀx¦s®æÅã¥Üªº®æ¦¡
  2.     ws.Cells(i, 2) = y                  '¦sªº­ÈÁÙ¬O¼Æ¦r
½Æ»s¥N½X

TOP

«D±`·PÁ¤j¤jªº«ü¾É  :)

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD