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

[µo°Ý] ¤å¦rÀÉ­n¦p¦ó¤Ï§Ç¶×¤JExcel ©O?

[µo°Ý] ¤å¦rÀÉ­n¦p¦ó¤Ï§Ç¶×¤JExcel ©O?

§Ú¦³¤@¤å¦rÀɶ·±qÀɮתº³Ì«á¤@¦æ¶}©l
µM«á­Ë¼Æªº¤G¦æ........¨ìÀÉ­º¶×¤JExcel

½Ð°Ý¸Ó¦p¦ó§ï©O? ·PÁ¦U¦ì!!!

Dim MyString As String

Open "MYFILE" For Input As #1    ' ¶}±Ò¿é¤JÀÉ¡C
i = 0
Do While Not EOF(1)              ' Àˬd¬O§_¤w¨ìÀɧÀ¡C
    Input #1, InputData          ' Ū¤J¤@¦æ¸ê®Æ¡C
    ActiveCell.Offset(0, i).Value = MyString   
    i = i + 1
Loop
Close #1                         ' Ãö³¬ÀɮסC

¦^´_ 1# mgame168
  1. Sub Ex()
  2. Dim MyString As String, i%
  3. Open "MYFILE" For Input As #1    ' ¶}±Ò¿é¤JÀÉ¡C
  4. i = 0
  5. Do While Not EOF(1)              ' Àˬd¬O§_¤w¨ìÀɧÀ¡C
  6.     Line Input #1, MyString      ' ±N¸ê®ÆŪ¤JÅܼƤ¤¡C
  7.     ActiveCell.Offset(i).Value = MyString     '©¹¤U¼g¤J
  8.     'ActiveCell.Offset(0, i).Value = MyString '©¹¥k¼g¤J
  9.     i = i + 1
  10. Loop
  11. Close #1
  12. End Sub
½Æ»s¥N½X

TOP

­ËµÛŪ³á?
  1. Sub nn()
  2. Dim Ar()
  3. Open "E:\restr.txt" For Input As #1
  4. Do While Not EOF(1)
  5. Line Input #1, mystr
  6. ReDim Preserve Ar(s)
  7. Ar(s) = StrReverse(mystr)
  8. s = s + 1
  9. Loop
  10. Close #1
  11. ay = Split(StrReverse(Join(Ar, Chr(10))), Chr(10))
  12. [A1].Resize(UBound(ay) + 1, 1) = Application.Transpose(ay)
  13. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¶}±ÒªºÀɮפ£¬O¯S¤j®É¥i¸Õ¸Õ
  1. Sub Ex()
  2.     Dim mystr$, Allstr$, Ar
  3.     Open "D:\Test\Test.txt" For Input As #1  
  4.     Do While Not EOF(1)
  5.         Line Input #1, mystr
  6.         Allstr = IIf(Allstr <> "", Allstr & "GBK", "") & mystr
  7.     Loop
  8.     Close #1
  9.     Ar = Split(Allstr, "GBK")
  10.     [A1].Resize(UBound(Ar) + 1, 1) = Application.Transpose(Ar)
  11. End Sub
½Æ»s¥N½X

TOP

·PÁ¨â¦ìª©¥D¤j¤OÀ°¦£~

©Î³\§Ú¨S§â°ÝÃD»¡²M·¡
°²³]
     E:\restr.txt
restr.txt ¤º®e
6
5
4
3
2
1

±ý¶×¤JExcel ªºµ²ªG
A    B    C    D    E    F
1    2    3    4    5    6

GBKEE ª©¥D
¥i¯à§Ú¥Îªº¸ê®Æ»P±zªº¤£¦P, ©Ò¥H¨Ì±z¤èªk±o¨ìªºµ²ªG¦p¤U:
6
5
4
3
2
1

Hsieh ª©¥D
¨Ì±z¤èªk±o¨ìªºµ²ªG, ­ËµÛŪ¹ï¤F, ¦ý¥Î°}¦C¶×¤Jªºµ²ªG
¨Ã¤£¬O§Ú·Q­nªº, ·Q¦A½Ð±zÀ°¦£,¶×¤Jªºµ²ªG¯à§_¥Ñª½¦¡
§ï¾î¦¡?

±z¤èªkªºµ²ªG
1
2
3
4
5
6

±ý¶×¤JExcel ªºµ²ªG
A    B    C    D    E    F
1    2    3    4    5    6

·PÁ¨â¦ìªºÀ°¦£

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-5-20 11:36 ½s¿è

¦^´_ 5# mgame168
¬O³o¼Ë¶Ü?      ¤£­n¥´Á¼ÃD
  1. Sub Ex()
  2.     Dim mystr$, Allstr$, Ar
  3.     Open "D:\Test.txt" For Input As #1
  4.     Do While Not EOF(1)
  5.         Line Input #1, mystr
  6.         If Len(mystr) > 0 And mystr <> " " Then Allstr = IIf(Allstr <> "", Allstr & "***", "") & mystr
  7.     Loop
  8.     Close #1
  9.     Ar = Split(StrReverse(Allstr), "***")
  10.     [A1].Resize(1, UBound(Ar)) = Ar
  11. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# GBKEE

·PÁÂGBKEE ª©¤j !!

¹ï¤F~ §Ú­nªº´N¬O±zªº¤èªk~ ·P®¦±z !!

¥t±NHsiehª©¤jªº¤èªk§ï¦¨
[A1].Resize(1, UBound(Ar) + 1) = Ar
¤]¬O§Ú­nªº

ÁÂÁ¨â¦ìªºÀ°¦£ !!

TOP

        ÀR«ä¦Û¦b : ¡i¦æµ½­n¤Î®É¡j¦æµ½­n¤Î®É¡A¥\¼w­n«ùÄò¡C¦p¿N¶}¤ô¤@¯ë¡A¥¼¿N¶}¤§«e¤d¸U¤£­n°±º¶¤õ­Ô¡A§_«h­«¨Ó´N¤Ó¶O¨Æ¤F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD