如何用perl 计算出C 的所有组合
答案:1 悬赏:40 手机版
解决时间 2021-11-16 08:56
- 提问者网友:风月客
- 2021-11-15 16:33
如何用perl 计算出C 的所有组合
最佳答案
- 五星知识达人网友:山河有幸埋战骨
- 2021-11-15 17:08
先上文件
文件中已经获得清单
我利用的是 VBA SQL 生成,完整代码如下:
Sub admin()
Dim conn As Object
Set conn = CreateObject("ADODB.Connection")
Select Case Application.Version * 1
Case Is <= 11
conn.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;" & _
"Extended Properties=Excel 8.0;" & _
"Data Source=" & ThisWorkbook.Path & "" & ThisWorkbook.Name
Case Is >= 12
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Extended Properties=Excel 8.0;" & _
"Data Source=" & ThisWorkbook.Path & "" & ThisWorkbook.Name
strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & PathStr & ";Extended Properties=""Excel 12.0;HDR=YES"";"""
End Select
conn.Open
sSql = "Select A.Êý×Ö & " " & B.Êý×Ö & " " & C.Êý×Ö & " " & D.Êý×Ö & " " & E.Êý×Ö From [Sheet1$] A,[Sheet1$] B,[Sheet1$] C,[Sheet1$] D,[Sheet1$] E Where A.Êý×Ö < B.Êý×Ö And B.Êý×Ö < C.Êý×Ö And C.Êý×Ö < D.Êý×Ö And D.Êý×Ö < E.Êý×Ö"
Range("C2:C" & Cells.Rows.Count).ClearContents
Range("C2").CopyFromRecordset conn.Execute(sSql)
conn.Close
Set conn = Nothing
End Sub
文件中已经获得清单
我利用的是 VBA SQL 生成,完整代码如下:
Sub admin()
Dim conn As Object
Set conn = CreateObject("ADODB.Connection")
Select Case Application.Version * 1
Case Is <= 11
conn.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;" & _
"Extended Properties=Excel 8.0;" & _
"Data Source=" & ThisWorkbook.Path & "" & ThisWorkbook.Name
Case Is >= 12
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Extended Properties=Excel 8.0;" & _
"Data Source=" & ThisWorkbook.Path & "" & ThisWorkbook.Name
strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & PathStr & ";Extended Properties=""Excel 12.0;HDR=YES"";"""
End Select
conn.Open
sSql = "Select A.Êý×Ö & " " & B.Êý×Ö & " " & C.Êý×Ö & " " & D.Êý×Ö & " " & E.Êý×Ö From [Sheet1$] A,[Sheet1$] B,[Sheet1$] C,[Sheet1$] D,[Sheet1$] E Where A.Êý×Ö < B.Êý×Ö And B.Êý×Ö < C.Êý×Ö And C.Êý×Ö < D.Êý×Ö And D.Êý×Ö < E.Êý×Ö"
Range("C2:C" & Cells.Rows.Count).ClearContents
Range("C2").CopyFromRecordset conn.Execute(sSql)
conn.Close
Set conn = Nothing
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯