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

[µo°Ý] ¿z¿ï«á¥t¦sPDF¿ò¥¢¤F¼ÐÃD¦C

[µo°Ý] ¿z¿ï«á¥t¦sPDF¿ò¥¢¤F¼ÐÃD¦C

¤j¤j, ½Ð½ç±Ð,

¦³¤@­ÓVBAÀÉ, ¿z¿ï«á¥t¦sPDF, ¦ý¨S¦³A1¦ÜJ5ªº¼ÐÃD¥]¬A¤é´Á¤Î¬P´Á, ½Ð°Ý¥¼ª¾¨º¸Ì¥X¿ù?

¥X¶Ô (2).zip (561.89 KB)

¥»©«³Ì«á¥Ñ missbb ©ó 2016-12-12 14:26 ½s¿è

¦A¸Õ¤U¦CCODE, ³£µLªk±NROW 1¦C¥X, ¨D¤j¤j½ç±Ð?
  1. [code]Sub printPDF_4()
  2. 'pdf for shop reporting errors

  3. Dim xPath As String
  4. Dim d As Object
  5. Dim A As Variant
  6. Dim f As String
  7. Dim ky As Variant
  8. Dim rng As Range
  9.   

  10.   ActiveSheet.PageSetup.PrintArea =   ActiveCell.CurrentRegion.Address
  11.   Set rng = ActiveSheet.UsedRange

  12.     xPath = Application.ActiveWorkbook.Path
  13.     Set d = CreateObject("Scripting.Dictionary")

  14.     With Worksheets("attendance report")
  15.         For Each A In .Range(.[c3], .[c3].End(xlDown))
  16.         d(A.Value) = ""
  17.             Next

  18.             f = InputBox("¿é¤JPDFÀɪº¤ë¥÷, ¨Ò:201508")
  19.                 If f = "" Then Exit Sub

  20.     For Each ky In d.KEYS
  21.          .Range("c3").AutoFilter field:=3, Criteria1:=ky
  22.          
  23.         If Dir(xPath & "\" & ky & "_" & f & ".pdf") <> "" Then Kill xPath & "\" & ky & "_" & f & ".pdf" '¦P¦WÀɮקR°£
  24.         
  25.         rng.ExportAsFixedFormat Type:=xlTypePDF, fileName:= _
  26.             xPath & "\" & ky & "_" & f & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
  27.                 IgnorePrintAreas:=False, OpenAfterPublish:=False  '¥t¦s¦¨PDFÀÉ®×

  28. Next

  29. If .FilterMode = True Then .ShowAllData 'Åã¥Ü©Ò¦³¸ê®Æ

  30. End With
  31. End Sub
½Æ»s¥N½X
[/code]

TOP

        ÀR«ä¦Û¦b : ¡i®É¤é²öªÅ¹L¡j¤@­Ó¤H¦b¥@¶¡°µ¤F¦h¤Ö¨Æ¡A´Nµ¥©ó¹Ø©R¦³¦hªø¡C¦]¦¹¥²¶·»P®É¶¡Ävª§¡A¤Á²ö¨Ï®É¤éªÅ¹L¡C
ªð¦^¦Cªí ¤W¤@¥DÃD