- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2016-5-1 05:16 ½s¿è
¦^´_ 3# kathych - Private Sub cbCreat_Click()
- Dim iCol%, iCols%
- Dim lSRow&, lTRow&
- Dim sPath$, sStr1$, sStr2$
- Dim wsTar As Worksheet
- Dim vD As Object
-
- Set vD = CreateObject("Scripting.Dictionary")
- sPath = ThisWorkbook.Path
- ChDrive sPath
- ChDir sPath
-
- With Sheets("Á`ªí")
- iCols = .Cells(2, Columns.Count).End(xlToLeft).Column
- iCol = 1
- While iCol <= iCols
- If .Cells(2, iCol) <> "" Then vD(Trim(.Cells(2, iCol))) = iCol
- iCol = iCol + 1
- Wend
-
- lSRow = 3
- While .Cells(lSRow, 1) <> ""
- Set wsTar = Sheets(CStr(.Cells(lSRow, 2)))
- With wsTar
- .[C2:C14].ClearContents
- .[E3:E14].ClearContents
- With .[E2] ' ¤ë©³¨º¶g´N¥i¥H²£¥Í¦¸¤ëªºÁ~¸ê±ø
- .NumberFormat = "mmm.,yyyy"
- .Value = Now() - 7
- End With
- End With
-
- wsTar.[C2] = .Cells(lSRow, vD("û¤u©m¦W"))
-
- lTRow = 3
- Do While 1
- If wsTar.Cells(lTRow, 2) <> "" Or wsTar.Cells(lTRow, 4) <> "" Then
- sStr1 = Trim(wsTar.Cells(lTRow, 2))
- If sStr1 = "Total" Then Exit Do ' ¹J¨ì Total ¸õ¥X°j°é
- sStr2 = Trim(wsTar.Cells(lTRow, 4))
- If sStr1 <> "" Then wsTar.Cells(lTRow, 3) = .Cells(lSRow, vD(sStr1))
- If sStr2 <> "" Then wsTar.Cells(lTRow, 5) = .Cells(lSRow, vD(sStr2))
- End If
- lTRow = lTRow + 1
- Loop
-
- With wsTar
- .Copy ' ¸g¹ê´ú,¥»¦æ¸õ¦æ®É·|¥t²£¥Í¤@Ó¤u§@ï¨Ã¶K¤W²Ä¤@Ó¤u§@ªí, ©Ò¥H¥i¥H¤£¥Î¥[ PasteSpecial «ü¥O
- With ActiveSheet
- .Name = "Á~¸ê±ø"
- With .Parent
- .SaveAs wsTar.[C2] & "-" & Format(wsTar.[E2], "yyyymm") & "Á~¸ê±ø.xls"
- .Close
- End With
- End With
-
- .PrintPreview
- ' ³o¸Ì©ñÂনPDFÀɪº«ü¥O,ÁÙ¨S´ú¸Õ¥X¨Ó«ç»ò°µ
-
- .[C2:C14].ClearContents
- .[E3:E14].ClearContents
- End With
- lSRow = lSRow + 1
- Wend
- End With
- End Sub
½Æ»s¥N½X
Test2-a.zip (17.51 KB)
|
|