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

½Ð±Ð¥Ñ¥¨¶°¿ý¨îªº¤½¦¡¦p¦óÂà´«¬°VBA¤½¦¡,¨Ã¥BÀx¦s®æ¥i¥H¬OÅܼÆ

¦^´_ 8# luffyzoro
  1. Option Explicit
  2. Sub Ex()
  3.     Dim hubopf As String, AR
  4.     hubopf = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
  5.     If hubopf = "False" Then MsgBox "½Ð¿ï¨úÀÉ®×": Exit Sub
  6.     AR = Split(hubopf, "\")
  7.     hubopf = AR(UBound(AR))   'hubopf = "B.xls"ÀHµÛ¶}±ÒÀɦW¤£¦P¤]¥i¯à¬O"C.xls"
  8.     Workbooks.Open hubopf     'Workbooks( hubopf )
  9. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-11-24 16:00 ½s¿è

¦^´_ 10# luffyzoro
§ï¦¨ActiveCell.FormulaR1C1 = _
        "=IF(AND(RC[-1]=[" & hubopf & "]AC8E!R" & hubcn & "C2,[" & hubopf & "]AC8E!R" & hubcn & "C72>0,[" & hubopf & "]
AC8E!R" & hubcn & "C72-SUM(R" & mycarw & "C11:RC[5])>0),[" & hubopf& "]AC8E!R" & hubcn & "C9)"

ActiveCell.FormulaR1C1 = _
        "=IF(AND(RC[-1]=[hubopf]AC8E!R" & hubcn & "C2,[hubopf]AC8E!R" & hubcn & "C72>0,[hubopf]AC8E!R" & hubcn & "C72-SUM(R" & mycarw & "C11:RC[5])>0),[hubopf]AC8E!R" & hubcn & "C9)"
§Aª¾¹D hubcn ¬OÅܼƭn¦p¦¹ªº¥[¤JÅܼƠ & hubcn &
¦P²z hubopf ¬OÅÜ¼Æ ¤]­n¦p¦¹°µªº

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-11-25 16:30 ½s¿è

¦^´_ 13# luffyzoro
8¼Ó: °²³]§Úªº¥¨¶°¬O¼g¦bA.xls , ¥ÎA.xls¶}±ÒB.xls , ·Óª©¤jªº¤è¦¡§Úªºhubopf·|±o¨ì"D:\C¸ê®Æ§¨\F¸ê®Æ§¨\B.xls"

hubopf ="B.xls"
[" & hubopf & "]¦p¥Ø«eºÏºÐ¾÷ªº¸ô®|¤£¬O D:\C¸ê®Æ§¨\F¸ê®Æ§¨  Excel·|§ä¤£¨ìÀɮתº  
½Ð§A¦b¾A·íªº¦a¤è¥[¤J   ChDir  "D:\C¸ê®Æ§¨\F¸ê®Æ§¨"    ²¾°Ê¥Ø«eºÏºÐ¾÷ªº¸ô®|

TOP

¦^´_ 15# luffyzoro
9¼Óªº¿ù»~   ³o¸Ì·|¸õ¥X¹ï¸Ü®Ø­n¨D§Ú¿ï¾Ü¶}±ÒÀÉ®×,  ChDir "H:\My documents\±M®×\¤u§@¶q±M®×"    «á9¼Óªº¿ù»~®ø¥¢¤F

15¼Ó¿ù»~°T®§  °õ¦æ¶¥¬q¿ù»~'1004':À³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~
³oµ{¦¡½X §Ú¥N¤JÅÜ¼Æ hubopf   , hubcn,  ¨S¦³¿ù»~,  ½ÐÀˬd¨C¤@  Workbooks (hubopf) ¤¤¬O§_ ¦³¤u§@ªí¦WºÙ"AC8E"
ActiveCell.FormulaR1C1 = _
        "=IF(AND(RC[-1]=[" & hubopf & "]AC8E!R" & hubcn & "C2,[" & hubopf & "]AC8E!R" & hubcn & "C72>0,[" & hubopf & "]AC8E!R" & hubcn & "C72-SUM(R" & mycarw & "C11:RC[5])>0),[" & hubopf & "]AC8E!R" & hubcn & "C9)"

TOP

¦^´_ 17# luffyzoro
½ÐÀˬd¨C¤@  Workbooks (hubopf) ¤¤¬O§_ ¦³¤u§@ªí¦WºÙ"AC8E"
=[" & hubopf & "]AC8E!R" & hubcn & "C2
³o¤½¦¡ hubopf  ·|¬O "b.xls" ."c.xls" "d.xls"  ¤£¤@©wªºÀÉ®× ,  AC8E »Ý¬O³o¨ÇÀɮפ¤¤@©w¦³ªº¤u§@ªí¦WºÙ

TOP

¦^´_ 19# luffyzoro
¾É­P¤½¦¡¨Ã¨S¦b§Ú­nªºÀx¦s®æ¤º?  §A³o·N«ä¬OActiveCellªº¦ì¸m¤£¹ï!

§Úµù¸Ñ§A¬Ý¬Ý
Cells(ActiveSheet.Rows.Count, 6).End(xlUp).Select  'FÄæ¸Ì³Ì«á¤@­Ó¸ê®ÆªºCells
Selection.Offset(1, 0).Select                                         
FÄæ¸Ì³Ì«á¤@­Ó¸ê®ÆªºCellsªº¤U¤@¦CªºCells   ³o´N¬O ActiveCell  ¹ï¤£¹ï!

TOP

¦^´_ 19# luffyzoro
9# ¬O¤£¬O§Ú­þÃä¼g¿ù¤F,¾É­P¤½¦¡¨Ã¨S¦b§Ú­nªºÀx¦s®æ¤º?
§A­nªº¬O¦³¤½¦¡, ¤£­n¥u¬O­È ¹ï¶Ü?
Selection.Value = Selection.Value   '³o¸Ì ¤½¦¡³Q­È¨ú¥N ¤F
ActiveCell.Offset(1).Select

TOP

¦^´_ 23# luffyzoro
¦Ó¥B³v¦æ°õ¦æ¬O¨ì¤½¦¡¨º¤@¦C´N¿ù»~¤F   

½Ð°ÝWorkbooks( hubopf )¤¤¦³ AC8E ³o¤u§@ªí¶Ü?

ActiveCell.FormulaR1C1 = _
"=IF(AND(RC[-1]=[" & hubopf & "]AC8E!R" & hubcn & "C2,[" & hubopf & "]AC8E!R" & hubcn & "C72>0,[" & hubopf & "]AC8E!R" & hubcn & "C72-SUM(R" & mycarw & "C11:RC[5])>0),[" & hubopf & "]AC8E!R" & hubcn & "C9)"

TOP

¦^´_ 19# luffyzoro
ª©¤jÄ@·Nªº¸Ü,§Ú¥i¥H±NÀÉ®×±Hµ¹ª©¤jÀ°¦£¬Ý¤@¤U
½Ð¦b§A­Ó¤H¸ê®Æ ¯d¤U Mail

TOP

        ÀR«ä¦Û¦b : Ä@­n¤j¡B§Ó­n°í¡B®ð­n¬X¡B¤ß­n²Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD