¦p¦ó§ïµ½³o¬qµ{¦¡¡AÅý°õ¦æ®Ä²v´£¤É¡H
- ©«¤l
- 703
- ¥DÃD
- 276
- ºëµØ
- 0
- ¿n¤À
- 1005
- ÂI¦W
- 1
- §@·~¨t²Î
- Windows 10
- ³nÅ骩¥»
- Office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-6-30
- ³Ì«áµn¿ý
- 2024-5-29
|
¦p¦ó§ïµ½³o¬qµ{¦¡¡AÅý°õ¦æ®Ä²v´£¤É¡H
- Sub test()
- '¦~«×¤ÀªR¡A¶}¾P«e3¦W
- Application.ScreenUpdating = False
- W = [W]
- r = [A1].CurrentRegion.Rows.Count
- Range("B7:M" & r).ClearContents
- Range("B2:M3").ClearContents
- myyear = [A1].Value
- For c = 2 To 13
- mymonth = myyear & "/" & Trim(Cells(1, c).Value)
- income = 0
- expense = 0
- pay = 0
- v = 11
- With Sheets("DataCopy")
- er = .[A100000].End(3).Row
- For r = 2 To er
- If myyear & "/" & Format(.Cells(r, 1).Value, "m¤ë¥÷") = mymonth Then
- money = Val(.Cells(r, 3).Value)
- Select Case .Cells(r, 2).Value
- Case "¦¬¤J": income = income + money
- Case "¤ä¥X": expense = expense + money
- Case "¤À´Á¥I´Ú": expense = expense + money: pay = pay + 1
- End Select
- myitem = .Cells(r, 4).Value
- If .Cells(r, 2).Value <> "¦¬¤J" Then
- Set cell = Columns(c + 1).Find(myitem)
- If Not cell Is Nothing Then
- cell.Offset(, -1).Value = cell.Offset(, -1).Value + money
- Else
- Cells(v, c).Value = money
- Cells(v, c + 1).Value = .Cells(r, 4).Value
- v = v + 1
- End If
- End If
- End If
- Next r
- If Cells(11, c) <> "" Then
- Set rng = Range(Cells(11, c), Cells(v - 1, c + 1))
- rng.Sort key1:=Cells(11, c), order1:=xlDescending
- X = 0
- v = 11
- Do Until Cells(v, c).Value = ""
- If InStr(W, Cells(v, c + 1)) = 0 Then
- If X < 3 Then
- X = X + 1
- Cells(X + 6, c).Value = X & ". " & Cells(v, c + 1).Value & " / " & Cells(v, c).Value & "¤¸"
- End If
- End If
- Cells(v, c).Value = v - 10 & ". " & Cells(v, c + 1).Value & " / " & Cells(v, c).Value & "¤¸"
- Cells(v, c + 1).Value = ""
- v = v + 1
- Loop
- End If
- End With
- Cells(2, c).Value = IIf(income <> 0, income, "")
- Cells(3, c).Value = IIf(expense <> 0, expense, "")
- Cells(10, c).Value = pay
- Next c
- Application.ScreenUpdating = True
- '¦Û°Ê´«¦æ
- Rows("7:100000").EntireRow.AutoFit
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X ¥H¤W¬O¬Y¦ì¦Ñ®v¼¶¼g¡A¦³ÂI§Ñ¤F¬O½Ö(¥¢Â§¤F)¡A쥻³£¥ÎXPªºExcel°õ¦æ¡A®Ä²v³£ÁÙOK¡A
´«¦¨2010«á¡A°õ¦æ¥H«á·|Åܱo«D±`«D±`ªººC¡A¤£ª¾¹D¦³¨S¦³¿ìªk§ïµ½¡AÁÂÁ¡I |
|
|
|
|
|
|
- ©«¤l
- 549
- ¥DÃD
- 152
- ºëµØ
- 0
- ¿n¤À
- 691
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- OFFICE 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-8-10
- ³Ì«áµn¿ý
- 2022-9-7
|
¦^´_ 1# av8d
¬yµ{ªº³¡¤À§Ú¨S¦³¤ÀªR,¦ý§Ú½T©wªº¬O¥i¥H¥Î°}¦C·|°õ¦æªº§ó§Ö
¦]¬°°}¦Cªº¹B§@³t«×·|¤ñŪ¨úCELLS§ÖN¿
¦b¶}ÀYªº¦a¤è¥ý
AR=[a1].currentregion'¦¹¦æ·ÀI¦b©ó¤¤Â_ªºÀx¦s®æ,Y¦³¤¤Â_ªºÀx¦s®æ½Ð¥Î¤U¤è
AR=[a1].resize(x,y)'¥i¦Ûq°}¦C¤j¤p
¤§«áAR(1,1) ´N·|µ¥©ó cells(1,1)=>¦]¦¹±Nµ{¦¡½X¨ú¥N§Y¥i, ¦Ó.valueªº³¡¤À«h¥i§R°£
with ªº³¡¤À¤@¼Ë¥ÎAR2=.[a1].currentregion'§Y¥i,AR2(1,1)=.cells(1,1)
¦ý«á±sortªº³¡¤Àn«O¯d쥻ªºCELLS¤~¤£·|¦³°ÝÃD
¥H¤Î³Ì«á¿é¥Xªº.cells.value¦]¬°n¿é¥X,·íµM¤£¥i¨ú¥N¬°°}¦C |
|
PKKO
|
|
|
|
|