½Ð±Ð¥Ñ¥¨¶°¿ý¨îªº¤½¦¡¦p¦óÂà´«¬°VBA¤½¦¡,¨Ã¥BÀx¦s®æ¥i¥H¬OÅܼÆ
- ©«¤l
- 23
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-11-21
- ³Ì«áµn¿ý
- 2013-4-9
|
½Ð±Ð¥Ñ¥¨¶°¿ý¨îªº¤½¦¡¦p¦óÂà´«¬°VBA¤½¦¡,¨Ã¥BÀx¦s®æ¥i¥H¬OÅܼÆ
ActiveCell.FormulaR1C1 = _
"=IF(AND(RC[-1]=[hub.xls]AA!R2C2,[hub.xls]AA!R2C24>0,[hub.xls]AA!R2C24-SUM(R2C11:RC[5])>0), [hub.xls]AA!R2C9)"
ActiveCell.Offset(1).Select
½Ð±Ð¦U¦ìª©¤j¡A¦p¤W¤½¦¡¬°±q¥¨¶°COPY¨ìVBA¤¤¡A¦ý¬O²{¦b§Ú¦³°ÝÃDµLªk¸Ñ¨M¡A
¦pªG[hub.xls]AA!R2C2¤Î[hub.xls]AA!R2C24¤Î[hub.xls]AA!R2C24¤Î[hub.xls]AA!R2C9³o¥|Ó¬O¥t¥~¤@Ó
Àɮפ¤ªºÀx¦s®æ³£¦b¦P¤@¦C¡A²{¦b§Ú»Ýn±N"¦æ"¬O¥i¥HÅܰʪº¡A¸Ó¦p¦óקï?
¥t¥~[hub.xls]AA!R2C24-SUM(R2C11:RC[5])>0³oӸ̱ªºSUM(R2C11:RC[5])ªº²Ö¥[À³¸Ó¬On¥u²Ö¥[»P[hub.xls]AA!R2C9ªºÈ¤@¼Ë¸ÓÀx¦s®æ¹ïÀ³¨ì¦P¤@¦Cªº¼Æ¶qÀx¦s®æ§@²Ö¥[
¥i§_½Ð°ª¤âÀ°¦£¬Ý¤@¤U¸Ó«ç»ò¼gVBA¤ñ¸û¦n |
|
|
|
|
|
|
- ©«¤l
- 23
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-11-21
- ³Ì«áµn¿ý
- 2013-4-9
|
¥»©«³Ì«á¥Ñ luffyzoro ©ó 2011-11-22 02:59 ½s¿è
·q½Ð«üÂI.rar (34.38 KB)
¦^´_ 2# Hsieh
ª©¤j±z¦n
·PÁ±z¼ö¤ß¦^ÂÐ
¤p§Ì¦]¤u§@»Ýn,¦]¦¹À|¸Õ¼gVBA
¼g¤F¤@°ï¦Û¤v¬Ý¤F³£«Ü½ÆÂøªºµ{¦¡½X,¼g¨ì¥d¦í¤F
Àµ½Ðª©¤j¶}ÄÀ
¸Ó¥Î¤°»ò¼gªk¤~¯à§¹¦¨¤p§Ì·Qn¹F¦¨ªº§¹¦¨ÀÉ
¨ä¤¤¦³ªþ¤W¤p§Ì¼gªº
Àµ½Ðª©¤j«üÂI |
|
|
|
|
|
|
- ©«¤l
- 23
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-11-21
- ³Ì«áµn¿ý
- 2013-4-9
|
¦^´_ 2# Hsieh
hubcn = 2
ActiveCell.FormulaR1C1 = _
"=IF(AND(RC[-1]=[hub.xls]AA!"R"&hubcn&"C2",[hub.xls]AA!"R"&hubcn&"C24">0,[hub.xls]AA!"R"&hubcn&"C24"-SUM(R2C11:RC[5])>0),[hub.xls]AA!"R"&hubcn&"C9")"
½Ð°Ýª©¤jY·Ó±zÁ|¨Ò¬O§_¬O¼g¦¨¦p¤W?³o¦¸§ÚnÅܰʪº¬Orows
¦ý¬O«o¥X²{»yªk¿ù»~?
½Ð°Ýþ¸Ì»Ýn×¥¿?
·PÁÂ |
|
|
|
|
|
|
- ©«¤l
- 23
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-11-21
- ³Ì«áµn¿ý
- 2013-4-9
|
¥»©«³Ì«á¥Ñ luffyzoro ©ó 2011-11-23 17:50 ½s¿è
¦^´_ 5# Hsieh
¦A¦¸·PÁ¤j¤j¨³³tªº¦^ÂÐ,§Ú¤S¦³·s°ÝÃD¤F
Application.Dialogs(xlDialogOpen).Show
Dim hubopf As String
hubopf = ActiveWorkbook.Name¡ö§Úªº¥Î·N¬On¨ú±o¥H¹ï¸Ü®Ø³Í±ÒÀɮתº¦WºÙ,¬O§_³o¸Ì¦³°ÝÃD?
Worksheets("AC-8E").Cells.Select
Worksheets("AC-8E").Range("A:BY").Sort Key1:=Worksheets("AC-8E").Range("D2"), _
Order1:=xlAscending, Key2:=Worksheets("AC-8E").Range("I2") _
, Order2:=xlAscending, Header:=xlYes
ThisWorkbook.Activate
Dim calopf As String
calopf = ThisWorkbook.Name
ActiveSheet.Cells.Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("C2"), _
Order2:=xlAscending, Key3:=Range("E2"), _
Order3:=xlAscending, Header:=xlYes
Cells(ActiveSheet.Rows.Count, 6).End(xlUp).Select
Selection.Offset(1, 0).Select
Workbooks(hubopf).Worksheets("AC-8E").Activate¡ö³v¦æ°õ¦æ¨ì³o¸Ì¥X²{¿ù»~"«¬ºA¤£²Å¦X"
½Ð°Ý¬O¤£¬O§Ú¦b«Å§ihubopf³oÓÅܼƮɦ³°ÝÃD?
·PÁ¤j¤j |
|
|
|
|
|
|
- ©«¤l
- 23
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-11-21
- ³Ì«áµn¿ý
- 2013-4-9
|
¦^´_ 7# Hsieh
ª©¤j¦A¦¸·PÁ±zªº¼ö¤ß
©êºp,§Ú¨S¦³§â°ÝÃD»¡²M·¡
°²³]§Úªº¥¨¶°¬O¼g¦bA.xls , ¥ÎA.xls¶}±ÒB.xls , ·Óª©¤jªº¤è¦¡§Úªºhubopf·|±o¨ì
"D:\C¸ê®Æ§¨\F¸ê®Æ§¨\B.xls"
¹ê»Ú¤W§Ú·Q±o¨ìªº¦r¦ê¥u¦³ "B.xls" ,¦]¬°¨C¦¸¶}ªºÀɦW¥i¯à¤£¤@¼Ë
©Ò¥H§Ú·Q±Nhubopf = "B.xls"
¦p¦¹«áÄòªºWorkbooks("hubopf")À³¸Ó´N·|·ÓµÛ¶}±Ò¤£¦PªºÀÉ®×°µÅÜ°Ê
½Ð°Ý
1.§Ú¸Ó¦p¦ó¨ú±ohubopf = "B.xls"ÀHµÛ¶}±ÒÀɦW¤£¦P¤]¥i¯à¬O"C.xls"
2.«áÄòn®M¥ÎWorkbooks¬On¼gWorkbooks(hubopf)ÁÙ¬On¼gWorkbooks("hubopf")?
·PÁÂ |
|
|
|
|
|
|
- ©«¤l
- 23
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-11-21
- ³Ì«áµn¿ý
- 2013-4-9
|
¦^´_ 9# GBKEE
·PÁÂGBKEEª©¤j
Dim hubopf As String, AR
hubopf = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If hubopf = "False" Then MsgBox "½Ð¿ï¨úÀÉ®×": Exit Sub
AR = Split(hubopf, "\")
hubopf = AR(UBound(AR)) 'hubopf = "B.xls"ÀHµÛ¶}±ÒÀɦW¤£¦P¤]¥i¯à¬O"C.xls"
Workbooks.Open hubopf 'Workbooks( hubopf )
¦p±zªº¨ó§U±N¤W±ªºµ{¦¡½X¨Ï¥Î¤§«á,³v¦æ°õ¦æ¨ì
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)"
³o¸Ì·|¸õ¥X¹ï¸Ü®Øn¨D§Ú¿ï¾Ü¶}±ÒÀÉ®×,¦pªG¤£¿ïÀÉ®×,¦bÀx¦s®æ´N·|§P§OFALSE,¿ï¤FÀɮפ~·|¥X²{§Únªºµ²ªG
§Úµo²{¬Ohubopf¨S¦³È,©Ò¥H¤Sn¨D«¶}ÀÉ®×,¥i¬O³oÓhubopf¬O¤@¶}©l´N«Å§iªº,¨ì¤F¤½¦¡®É«o¤S»Ý«¶}Àɮפ~¦³È,
§Úªº¥¨¶°¬O¼g¦bA.xlsªºsheet2 , ¦b¤Wz¤½¦¡°õ¦æ«e¦³¦h¦¸¤Á´«A.xls ©M B.xls , ³oÓ¤½¦¡¬O¦bA.xlsªºÀx¦s®æ¤¤,
½Ð±Ð¤j¤j,¦p¦ó¤~¯à¤£n«ùÄò«¶}ÀÉ®×?
·PÁÂ |
|
|
|
|
|
|