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

¼g¤@­Ó¥t¦s·sÀɪº¥¨¶°¡A¦ý¬O»Ý­n.pdf file¡A¨º»òÀ³«ç§ï¼g¡H

¼g¤@­Ó¥t¦s·sÀɪº¥¨¶°¡A¦ý¬O»Ý­n.pdf file¡A¨º»òÀ³«ç§ï¼g¡H

¦pªGµª¡§¬O¡¨¡A¥¿±`¹B§@¡A¦ý¬Oµª¡§§_¡¨·|¸õ¨ì°£¿ù¼Ò¦¡¡A½Ð°Ýµª¡¨§_¡§µ¥¦p°£®ø¡A«ç»ò½s¼g¡H

Sub SaveAS()
'
' ¥¨¶°1¥¨¶°
'
¬O§_¥t¦s·sÀÉ = InputBox("¬O§_¥t¦s·sÀÉ? ¬O¡GY, §_¡GN", , "Y")
File = Application.Range("D6")
Name = Application.Range("M7")
ActiveWorkbook.SaveAs Filename:=File & "-" & Name & ".xlsm"
     
End Sub

¦^´_ 1# Blade
  1. Sub SaveAS()
  2. ¬O§_¥t¦s·sÀÉ = MsgBox("¬O§_¥t¦s·sÀÉ?", vbYesNo)
  3. If ¬O§_¥t¦s·sÀÉ = vbYes Then
  4.     File = Application.Range("D6")
  5.     Name = Application.Range("M7")
  6.     ActiveWorkbook.SaveAS Filename:=File & "-" & Name & ".xlsm"
  7. End If
  8. End Sub
½Æ»s¥N½X
Excel 2010¨î§@PDF
  1. Sub PrintPDF()
  2. ¬O§_¥t¦s·sÀÉ = MsgBox("¬O§_¥Î·í«e­¶¨î§@PDF?", vbYesNo)
  3. If ¬O§_¥t¦s·sÀÉ = vbYes Then
  4.     File = Application.Range("D6")
  5.     Name = Application.Range("M7")
  6.    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
  7.         File & "-" & Name & ".pdf", Quality:=xlQualityStandard, _
  8.         IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
  9. End If

  10. End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

·PÁ¡I

¥t¤@­Ó°ÝÃD¡A¦pªGÀɮצWºÙ¤w¸g¦s¦b¡Aµª"¬O"´N¦p±`»\¤Fªº¡A¦ýµª"§_"¤S«ç¼g©O¡H

2012-12-17_170134.jpg (11.11 KB)

2012-12-17_170134.jpg

2012-12-17_170049.jpg (10.49 KB)

2012-12-17_170049.jpg

TOP

¦^´_ 2# kimbal


    ·PÁ¡I

¥t¤@­Ó°ÝÃD¡A¦pªGÀɮצWºÙ¤w¸g¦s¦b¡Aµª"¬O"´N¦p±`»\¤Fªº¡A¦ýµª"§_"¤S«ç¼g©O¡H

TOP

¦^´_ 4# Blade
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub PrintPDF()
  3.     Dim File_Name As String, xFile As String, xName As String
  4.     xFile = Range("D6")
  5.     xName = Range("M7")
  6.     File_Name = xFile & "-" & xName & ".pdf"
  7.     Do
  8.         File_Name = InputBox("¥t¦s·sÀÉ", "[ÀɮצsÀÉ]", File_Name)
  9.         If File_Name = "" Then
  10.             Exit Sub
  11.         Else
  12.             If Dir(File_Name) <> "" Then
  13.                 If MsgBox("ÀɮצWºÙ¸g¦s¦b,Âл\¥¦", vbYesNo) = vbYes Then
  14.                     Exit Do
  15.                 Else
  16.                     File_Name = ""
  17.                 End If
  18.             End If
  19.         End If        
  20.     Loop While Not UCase(File_Name) Like "*.PDF"
  21.    Application.DisplayAlerts = False
  22.    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
  23.         xFile & "-" & xName & ".pdf", Quality:=xlQualityStandard, _
  24.         IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
  25.     Application.DisplayAlerts = True
  26. End Sub
½Æ»s¥N½X

TOP

¦^´_  Blade
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2012-12-18 11:12


§Ú²{®Éªº½s½X¬O³o¼Ë
Sub SaveAS()
'
' Module2 Module
' invno
'

ActiveWorkbook.Save
¬O§_¥t¦s·sÀÉ = MsgBox("¬O§_¥t¦s·sÀÉ?", vbYesNo)
If ¬O§_¥t¦s·sÀÉ = vbYes Then
File = Application.Range("D6")
SNo = Application.Range("L7")
Name = Application.Range("M7")
ChDir "D:\Account book\INV"
ActiveWorkbook.SaveAS Filename:=File & "_" & SNo & "_" & Name & ".xlsm"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=File & "_" & SNo & "_" & Name & ".pdf", Quality:=xlQualityStandard _
        , IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End If

End Sub

2012-12-18_154822.jpg (35.6 KB)

2012-12-18_154822.jpg

TOP

¦^´_ 6# Blade
¦³¦ó°ÝÃD¶Ü?

TOP

¦^´_ 7# GBKEE
·PÁ¡I¦¨¥\¤F¡C

­ìÀɦWºÙ¬Oinv.xlsm
·í§Ú§¹¦¨¸ê®Æ®É
¦pªG§Ú¦P®É·Q¯d "xlsm" & "pdf"
¤§«á·|¦³¨â­ÓÀÉ®×
INV11345-©P¨ÌÀM.xlsm
INV11345-©P¨ÌÀM.pdf

¬O§_¥[¤J "¬õ¦âªº" ?

¥t¥~xNameªºx¬O§_¦³·N«äªº«ü¥Ü¡A¥ÎName¥i¥H¶Ü¡H

        Option Explicit
    Sub PrintPDF()
        Dim File_Name As String, xFile As String, xName As String
        xFile = Range("D6")
        xName = Range("M7")
        File_Name = xFile & "-" & xName & ".xlsm"
        File_Name = xFile & "-" & xName & ".pdf"
        Do
            File_Name = InputBox("¥t¦s·sÀÉ", "[ÀɮצsÀÉ]", File_Name)
            If File_Name = "" Then
                Exit Sub
            Else
                If Dir(File_Name) <> "" Then
                    If MsgBox("ÀɮצWºÙ¸g¦s¦b,Âл\¥¦", vbYesNo) = vbYes Then
                        Exit Do
                    Else
                        File_Name = ""
                    End If
                End If
            End If        
        Loop While Not UCase(File_Name) Like "*.xlsm"
        Loop While Not UCase(File_Name) Like "*.PDF"
       Application.DisplayAlerts = False
       ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            xFile & "-" & xName & ".pdf", Quality:=xlQualityStandard, _
            IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
        Application.DisplayAlerts = True
    End Sub

TOP

¦^´_ 8# Blade
Name ,File  ¬OVBA¨Ï¥ÎªºÃöÁä¦r  ÅܼÆ,µ{§Ç¦WºÙ­nÁקK¨Ï¥Î
  1. Option Explicit
  2. Sub PrintPDF()
  3.     Dim File_Name As String, xFile As String, xName As String
  4.     xFile = Range("D6")
  5.     xName = Range("M7")
  6.     File_Name = xFile & "-" & xName & ".xlsm"
  7.     'File_Name = xFile & "-" & xName & ".pdf"
  8.     Do
  9.         File_Name = InputBox("¥t¦s·sÀÉ", "[ÀɮצsÀÉ]", File_Name)
  10.         If File_Name = "" Then
  11.             Exit Sub
  12.         Else
  13.             If Dir(File_Name) <> "" Then
  14.                 If MsgBox("ÀɮצWºÙ¸g¦s¦b,Âл\¥¦", vbYesNo) = vbYes Then
  15.                     Exit Do
  16.                 Else
  17.                     File_Name = ""
  18.                 End If
  19.             End If
  20.         End If
  21.     'Loop While Not UCase(File_Name) Like "*.XLSM"   'UCase(File_Name) ¤j¼g *.XLSM
  22.     Loop While Not LCase(File_Name) Like "*.xlsm"   'LCase(File_Name) ¤p¼g *.xlsm
  23.     Application.DisplayAlerts = False
  24.     ActiveWorkbook.SaveAs Filename:=File_Name
  25.     File_Name = Replace(LCase(File_Name), "*.xlsm", ".dbf")  '°ÆÀɦW´À´«¬° "dbf"
  26.     ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
  27.         xFile & "-" & xName & ".pdf", Quality:=xlQualityStandard, _
  28.         IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
  29.     Application.DisplayAlerts = True
  30. End Sub
½Æ»s¥N½X

TOP

¦^´_ 9# GBKEE
·PÁ¡A¤Q¤À¦¨¥\¡C

§ÚªºINV File¬O©ñ©óD:\Account book\INV\INV.xlsm
§Ú¦Û¦æ¥[¤U¡§¬õ¦â¡§ªº­n¨D¡A¦ý¬O¥t¦s.pdf«á¡Afile¨ÌµM¶]¤F¥h¡§§Úªº¤å¥ó¡¨¸ê®Æ§¨¤º¡A½Ð°Ý§Ú¬O§_©ñ¿ù¤F«ü¥Oªº¦ì¸m©O¡H

¥t¤@­Ó°ÝÃD¡A¤µ¤Ñµo²{¤jÀY½¼ªº¦P¨Æ¡A¨C¦¸µoinvoiceªº®É­Ô¡A¸g±`§Ñ°O§ó§ïinvoice no¡A©Ò¥H¦P¤@­Óinvoice no¸g±`¥X²{©ó¤£¦Pªº«È¤á¦WºÙ¸Ì¡C

¨C¦¸µo³æ®É¡A¥t¦s«á³£¬O®æ¦¡ INV12345_·|­û½s¸¹1_«È¤á¦WºÙ1.pdf
¨ì¤F¤U¤@±i³æ®É¡A¦o¤S§Ñ¤F§ó§ïINV12345¡A¦]¦¹·|¥X²{ INV12345_·|­û½s¸¹2_«È¤á¦WºÙ2.pdf
½Ð°Ý¦³¨S¦³«ü¥O¤èªk¡A¦b¥t¦s®É¡A¥u°w¹ïInvoice noªº­«½Æ§@´£¥Ü

  'File_Name = xFile & "-" & xName & ".pdf"
ChDir "d:\Account book\INV\"
    Do
        File_Name = InputBox("¥t¦s·sÀÉ", "[ÀɮצsÀÉ]", File_Name)

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD