- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 3# jcchiang - Sub aa()
- Dim sSaveFile As String
- Dim cnn As New ADODB.Connection
- Dim rst As New ADODB.Recordset
- Dim sql As String
- Dim i As Long
- Dim myDate
-
- Do Until IsDate(myDate)
- myDate = Trim(InputBox("½Ð¿é¤J¬d¸ß°_©l¤é´Á", "¤é´Á", "YYYY/MM/DD"))
- Loop
-
- sSaveFile = "c:\test1.xlsx"
- cnn.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & ThisWorkbook.Path & "/Motion.mdb"
- With Workbooks.Add
- With Sheets(1)
- .Name = "main" '¤u§@ªí¦WºÙ
- sql = "SELECT entrydate,blade FROM CFData where entrydate>" & CLng(CDate(myDate))
- Set rst = cnn.Execute(sql)
- For i = 1 To rst.Fields.Count
- .Cells(1, i).Value = rst.Fields.Item(i - 1).Name
- Next i
- .[a2].CopyFromRecordset rst '½Æ»s¨ìA2Àx¦s®æ
- End With
- .SaveAs sSaveFile
- .Close
- End With
- cnn.Close
- Set rst = Nothing
- Set cnn = Nothing
- End Sub
½Æ»s¥N½X |
|