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

¦p¦ó§âEXCELªºÀx¦s®æ½d³òA1:H3000¿é¥X¨ì°O¨Æ¥»Àɮתº D:\SP20110801.TXT

¦^´_ 1# metrostar


    µ²ªG¤£ª¾¬O§_¥¿½T
  1. Sub test()

  2.     Open "d:\SP20110801.txt" For Output As #1
  3.     For r = 1 To [A65536].End(xlUp).Row
  4.         If r = 1 Then
  5.             c = Cells(1, 11).Resize(, 7)

  6.             mystr = Join(Application.Transpose(Application.Transpose(c)), ",")
  7.         Else
  8.             x = Cells(r, 1)
  9.             If IsNumeric(x) Then
  10.                 x = [j1] & Application.Text(x, "0000")
  11.             Else
  12.                 x = [j1] & x
  13.             End If
  14.             mystr = x & "," & "20110801" & "," & Cells(r, 3) & "," & Cells(r, 4) & "," & Cells(r, 5) & "," & Cells(r, 6) & "," & Cells(r, 8)
  15.         End If

  16.         Print #1, mystr
  17.     Next
  18.     Close #1
  19. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# metrostar
¹ï¤£°_¡A§Ú¤£¬O«Ó­ô¡A¾Çªø§ó¤£´±·í¡A¤~­è°_¨B¾Ç²ß¡C
  1. Sub test()
  2. With Sheet1
  3.     For r = 1 To .[A65536].End(xlUp).Row
  4.         If r = 1 Then
  5.             mystr = Array("<TICKER>", "<DTYYYYSSDD>", "<OPEN>", "<HIGH>", "<LOW>", "<CLOSE>", "<VOL>")
  6.         Else
  7.             x = .Cells(r, 1)
  8.             If IsNumeric(x) Then
  9.                 x = .[j1] & Application.Text(x, "0000")
  10.             Else
  11.                 x = [j1] & x
  12.             End If
  13.             mystr = Array(x, "20110802", .Cells(r, 3), .Cells(r, 4), .Cells(r, 5), .Cells(r, 6), .Cells(r, 8))
  14.         End If

  15. Sheet2.Cells(r, 1).Resize(, 7) = mystr
  16. Next
  17. End With
  18. End Sub
½Æ»s¥N½X

TOP

mystr = Array(x, Application.Text(Date, "yyyymmdd"), .Cells(r, 3), .Cells(r, 4), .Cells(r, 5), .Cells(r, 6), .Cells(r, 8))
§ï³o¦æ

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD