½Ð±Ð¥Ñ¥¨¶°¿ý¨îªº¤½¦¡¦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
|
¦^´_ 9# GBKEE - Sub Test()
- 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 )
- Worksheets("AC8E").Cells.Select
- Worksheets("AC8E").Range("A:BY").Sort Key1:=Worksheets("AC8E").Range("D2"), _
- Order1:=xlAscending, Key2:=Worksheets("AC8E").Range("I2") _
- , Order2:=xlAscending, Header:=xlYes
- ThisWorkbook.Activate
- Dim calopf As String
- calopf = ThisWorkbook.Name
- ActiveSheet.Cells.Select
- Selection.Sort Key1:=Range("E2"), Order1:=xlAscending, Key2:=Range("C2"), _
- Order2:=xlAscending, Key3:=Range("A2"), _
- Order3:=xlAscending, Header:=xlYes
- Cells(ActiveSheet.Rows.Count, 6).End(xlUp).Select
- Selection.Offset(1, 0).Select
- Workbooks(hubopf).Worksheets("AC8E").Activate
- Dim hubcn As Integer, hubrwcnt As Integer
- hubrwcnt = ActiveSheet.UsedRange.Rows.Count
- For hubcn = 2 To hubrwcnt - 1
- Workbooks(hubopf).Activate
- Worksheets("AC8E").Range("BT" & hubcn).Select
- If Selection.Value > 0 Then
- Workbooks(calopf).Worksheets("sheet2").Activate
- Dim mycarw As Integer
- mycarw = ActiveCell.Row
- Do
- 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)"
- Selection.Value = Selection.Value
- ActiveCell.Offset(1).Select
- Loop Until ActiveCell.Offset(-1).Value = False
½Æ»s¥N½X ´N¬O³o¼Ë¤lµM«á¨ì¤½¦¡®É´N¤@ª½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
|
¦^´_ 12# GBKEE
·PÁÂGBKEE¤j¤j¨³³t¦^ÂÐ
§ÚÁÙ¨Sµo°Ý«e¤w¦³§ï¹Lª©¤j©Ò±Ðªº¤è¦¡,¦ýÁÙ¬O°õ¦æ¿ù»~,¹ê¦b¬O¨S»³¤F,¥u¦n«pÁy¥Öªº¤@ª½¨Ó³oÃä½Ð±Ð
:L |
|
|
|
|
|
|
- ©«¤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-24 17:58 ½s¿è
¦^´_ 14# GBKEE
For hubcn = 2 To hubrwcnt - 1
Workbooks(hubopf).Activate
Worksheets("AC8E").Range("BT" & hubcn).Select
If Selection.Value > 0 Then
Workbooks(calopf).Worksheets("sheet2").Activate
Dim mycarw As Integer
mycarw = ActiveCell.Row Do
ChDir "H:\My documents\±M®×\¤u§@¶q±M®×"
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)"
Selection.Value = Selection.Value
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Offset(-1).Value = False
·PÁª©¤j
¦ý¬OÁÙ¬O¤@¼Ë¥X°ÝÃD
¿ù»~°T®§ °õ¦æ¶¥¬q¿ù»~'1004':À³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~
¤£¦n·N«ä°Ú,ª©¤j
ÂŦ⨺¤@¬q§Ú¬ÝÀx¦s®æ³£¦³¦bhubopf©Ò¥NªíªºÀɮײ¾°Ê
¥i¬O¨ì¤F¤½¦¡¨º¤@¬q´N¥X¿ù¤F
ÁٽбzÀ°¦£¬Ý¤@¤U¬O§_ÁÙ¦³þÃ䦳°ÝÃD |
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 16# GBKEE
½ÐÀˬd¨C¤@ Workbooks (hubopf) ¤¤¬O§_ ¦³¤u§@ªí¦WºÙ"AC8E"
½Ð°Ýª©¤j³o¥y¸Üªº·N«ä¬O«ü¦b¤½¦¡¤¤ªºÁÙ¬O»¡§Ú«ü©wªº¸ê®Æ§¨¨C¤@Àɮ׳£n¦³¤u§@ªí"AC8E"?
§Ú®³ª©¤j15¼Óªº¦^ÂФ½¦¡¶K¦^§Úªºµ{¦¡½X?¤´µM¥X²{¦P¼Ëªº¿ù»~°T®§
©Î¬O¸Ó¤½¦¡¦³¨S¦³¨ä¥Lªº¼gªk?¯u¤£ª¾¹D¬Oþ¸Ì¦³°ÝÃD?ÀY§ÖÃz¤F>"<
§ÚªºEXCELª©¥»¬O2003¦³®t¶Ü?
¦A¦¸·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
|
¦^´_ 18# GBKEE
ª©¤j±z¦n
¦A¦¸ÁÂÁÂ
¦p¦¹¦h¦¸³Â·Ð±z,¯u¬O¤£¦n·N«ä
§Ú²{¦b´N¥u¦³¤@Ó"b.xls"- Workbooks(hubopf).Worksheets("AC8E").Activate
- Dim hubcn As Integer, hubrwcnt As Integer
- hubrwcnt = ActiveSheet.UsedRange.Rows.Count
- For hubcn = 2 To hubrwcnt - 1
- Workbooks(hubopf).Activate
- Worksheets("AC8E").Range("BT" & hubcn).Select
- If Selection.Value > 0 Then
- Do
- Workbooks(calopf).Worksheets("sheet2").Activate
- Cells(ActiveSheet.Rows.Count, 6).End(xlUp).Select
- Selection.Offset(1, 0).Select
- Dim mycarw As Integer
- mycarw = ActiveCell.Row
- 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)"
- Selection.Value = Selection.Value
- ActiveCell.Offset(1).Select
- Loop Until ActiveCell.Offset(-1).Value = False
½Æ»s¥N½X ¥H¤W¬O¤ù¬qªºµ{¦¡½X,
§Ú·Q½Ð±Ðª©¤j,§Ú©Ò·QnªºActiveCell.FormulaR1C1 À³¸Ó¬O¦bWorkbooks(calopf).worksheets("sheet2")ªºÀx¦s®æ¤§¤¤,¬O¤£¬O§ÚþÃä¼g¿ù¤F,¾ÉP¤½¦¡¨Ã¨S¦b§ÚnªºÀx¦s®æ¤º?
©Î¬Oª©¤jÄ@·Nªº¸Ü,§Ú¥i¥H±NÀÉ®×±Hµ¹ª©¤jÀ°¦£¬Ý¤@¤U>"<
·PÁÂ |
|
|
|
|
|
|