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

[µo°Ý] 2±ø¥ó¤U°µ¸ê®Æ¾ã²z¬Û¥[

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2023-3-1 10:14 ½s¿è

¦^´_ 10# singo1232001

'«Üµw­nªºÁY¨ì·¥­­
Sub TEST()
Set CN = CreateObject("adodb.connection"): V = Application.Version: [F:H].ClearContents
If V >= 12 Then V = "Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=Excel 12.0; "
If V < 12 Then V = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0; "
CN.Open V & "Data Source=" & ThisWorkbook.FullName
q = "select ¤é´Á,²£«~,sum(¼Æ¶q)from[¤u§@ªí2$a1:C]group by ¤é´Á,²£«~ having ¤é´Á is not null"
Set RS = CN.Execute(q): [F1:H1] = [A1:C1].Value: [F2].CopyFromRecordset RS
End Sub

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD