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

[µo°Ý] ¸ê®ÆBUÄæ¨q¥X½Ð±Ð

[µo°Ý] ¸ê®ÆBUÄæ¨q¥X½Ð±Ð

DEAR ALL ¤j¤j
1.¦p¹Ï¤@µ{¦¡·|¨q¥X©óÀx¦s®æB4©¹¤U.
2.­Y§Ú¼g§ï ¨q¥X©óÀx¦s®æB4©¹¥k.¸Ó¦p¦ó­×§ï??
3.·Ð¤£§[½ç±Ð  THANKS*10000

¹Ï¤@
Sub aa()
Range("B4:D65536").ClearContents
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strsql As String
Z = 4

Do Until Range("A" & Z) = ""
cn.Open "Provider=MSDAORA.1;Password=BATCH;User ID=URCE01B;Data Source=QSRS05A"
strsql = "SELECT TBDD2002.PN" & Chr(13) & "" & Chr(10) _
       & "FROM TBDD2002,TBDD2040" & Chr(13) & "" & Chr(10) _
       & "Where TBDD2002.PN=TBDD2040.PN AND SUBSTR('" & Range("A" & Z) & "',1,6)=SUBSTR(TBDD2002.PN,1,6) and NVL(FORMALPN,'A') IN 'FS'"

rs.Open strsql, cn
Range("B" & Z).CopyFromRecordset rs


rs.Close
cn.Close
Z = Z + 1
Loop
End Sub
ù

DEAR ALL ¤j¤j
1.¦p¹Ï¤@µ{¦¡·|¨q¥X©óÀx¦s®æB4©¹¤U.
2.­Y§Ú¼g§ï ¨q¥X©óÀx¦s®æB4©¹¥k.¸Ó¦p¦ó­×§ï??
3.·Ð¤£ ...
rouber590324 µoªí©ó 2018-1-9 13:23



    Range("B" & Z)Àx¦s®æªº¥t¤@­Óªí¥Ü¤è¦¡¬° CELLS(Z,"B") ¡A¨ä¤¤ªºB¤]¥i¥H¥Î¼Æ¦rªí¥ÜCELLS(Z,2)¡A

    ©Ò¥H­Y¬O­nB4¦V¥kªº¸Ü¡A¥i¥H§ï¼g¬°CELLS(4,Z)¡AZ¬°ÅܼơA¨C¦¸+1 ´N·|©¹¥k¶]¤@®æ¤F¡C

TOP

DEAR  kim223824  ¤j¤j
100%²Å¦X»Ý¨D.THANKS*10000
ù

TOP

        ÀR«ä¦Û¦b : ¦³´¼¼z¤~¯à¤À¿ëµ½´c¨¸¥¿¡F¦³Á¾µê¤~¯à«Ø¥ß¬üº¡¤H¥Í¡C
ªð¦^¦Cªí ¤W¤@¥DÃD