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

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

¦^´_ 20# Blade
¬O17#ªºµ{¦¡½X¦³»~ ¤w­×¥¿

TOP

¦^´_ 17# GBKEE
:) ¦¨¥\¤F¡A·PÁ¡I
½Ð°Ýª©¤j§A§ï¤F¨º¸Ì©O¡H§Ú¬Ý¤F´X¹MÁÙ¬O§ä¤£¨ì¡A¤£¦P¤§³B¡C
  1. If Dir("d:\Account book\INV\*" & xSNo & "*.pdf ") <> "" Then
  2.      MsgBox "¡iª`·N¡j¦¹¦¬¾Ú½s¸¹ " & xSNo & " ¦­«e¤w¶}¥X¡A½Ð­«·s¿é¤J¡C"
  3.     Exit Sub
  4.         End If
½Æ»s¥N½X
¦pªG§Ú·Q§âcode§ï¦¨¦p¤U¡A¤£½×¬O xFile¡BxSNo¡BxName¡A¬O§_³£¬O©ñ¦b¦P¤@¦ì¸m¡H
  1. If Dir("d:\Account book\INV\*" & xFile & "*.pdf ") <> "" Then
  2.      MsgBox "¡iª`·N¡j¦¹¦¬¾Ú½s¸¹ " & xFile & " ¦­«e¤w¶}¥X¡A½Ð­«·s¿é¤J¡C"
  3.     Exit Sub
  4.         End If
½Æ»s¥N½X

TOP

¦^´_ 22# Blade
20#  If Dir("d:\Account book\INV\*" & " xSNo " & "*.pdf ") <> "" Then
¦h¤F¨â­Ó"   ,   " xSNo " ¬°¦r¦ê-> "d:\Account book\INV\* xSNo  *.pdf "  

¥¿½T:
If Dir("d:\Account book\INV\*" & xSNo & "*.pdf ") <> "" Then
¦p xSNo="test"
¦r¦ê="d:\Account book\INV\*" & "test"& "*.pdf "

TOP

¥»©«³Ì«á¥Ñ Blade ©ó 2012-12-22 14:30 ½s¿è
¦^´_  Blade
20#  If Dir("d:\Account book\INV\*" & " xSNo " & "*.pdf ")  "" Then
¦h¤F¨â­Ó"   ,   " ...
GBKEE µoªí©ó 2012-12-22 11:45

¦¨¥\¤F:D

§Ú²{®É¥Î¤F¤@­Ó¤ñ¸û²Âªº¤èªk¡A¥h¥´¤J¦¬¾Ú½s¸¹¡A
«K¬O«ö¤@¤U¦¬¾Ú½s¸¹¹j¾Fªº¬õ¦â«ö¶s¡A«K·|¸õ¨ìinvno¨ºsheet¤§«á«ö
¤@¤Uªø¤è¬õ¦â«ö¶s¡A«K°Å¶K¦^¦¬¾Ú½s¸¹¨º³B¡A
¨C¤@¦¸³£¬O³o¼Ë¡C
¦pªG¬õ¦â¨º¦Cªº½s¸¹¥Î§¹¡A«K«ö¤@¤Uºñ¦âªº«ö¶s¡A§â¨º¦æªº½s¸¹°Å¶K¨ì³Ì¥ª­±¬õ¦â«ö¶s³B¨Ó¸É¥R
½Ð°Ý¦³¬Æ»ò¦nªº¤è¦¡¥h¶W¶V³o¤èªk¡H

2012-12-22_142408.jpg (143.4 KB)

2012-12-22_142408.jpg

2012-12-21_164758.jpg (84.12 KB)

2012-12-21_164758.jpg

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-12-22 16:57 ½s¿è

¦^´_ 24# Blade
  1. Option Explicit
  2. Sub ¥t¦s·sÀÉ´ú¸Õ()
  3.     Dim File_Name As String, xFile As String, xSNo As String, xName As String
  4.         xFile = Range("D6")
  5.         xSNo = Range("L7")
  6.         xName = Range("M7")
  7.                 File_Name = xFile & "_" & xSNo & "_" & xName & ".pdf"
  8.                                 ActiveWorkbook.Save
  9.     ChDrive "D:\"    '¤wÂà´«ºÏºÐ¾÷ ³o¦æ¤£»Ý­n If Mid(CurDir, 1, 1) <> "d" Then ChDrive "d:\"
  10.     ChDir "d:\Account book\INV\"
  11.     If Dir("d:\Account book\INV\*" & xSNo & "*.pdf ") <> "" Then
  12.         MsgBox "µo²¼½s¸¹   " & xSNo & "   ¤w¶}¥X"
  13.         Exit Sub
  14.     End If
  15.     Do
  16.         File_Name = InputBox("¥t¦s·sÀÉ", "[ÀɮצsÀÉ]", File_Name)
  17.         If File_Name = "" Then
  18.             Exit Sub
  19.         Else
  20.             If Dir(File_Name) <> "" Then
  21.                 If MsgBox("¡iª`·N¡jÀɮצWºÙ¤w¸g¦s¦b¡C¬O§_­nÂл\¥¦¡H¦pÂл\¥¦¸ê®Æ±N·|³Q§ó·s¡C", vbYesNo) = vbYes Then
  22.                     Exit Do
  23.                 Else
  24.                     File_Name = ""
  25.                 End If
  26.             End If
  27.         End If
  28.     Loop While Not UCase(File_Name) Like "*.PDF"
  29.     ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=xFile & "_" & xSNo & "_" & xName & ".pdf", Quality:=xlQualityStandard _
  30.         , IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
  31.     µo²¼§ó·s
  32. End Sub
½Æ»s¥N½X
  1. Sub µo²¼§ó·s()
  2.     Dim xSNo As Range, i As Integer, y As Integer, R As Integer, RR As Integer
  3.     Set xSNo = Range("L7")
  4.     y = Len(xSNo)                                      '[µo²¼½s¸¹]ªº¦r¦ê­Ó¼Æ
  5.     For i = 1 To y
  6.         If R = 0 And Mid(xSNo, i, 1) Like "[0-9]" Then R = i    '§ä[µo²¼½s¸¹]¤¤²Ä¤@­Ó¼Æ¦r
  7.         If Mid(xSNo, i, 1) Like "[!0-9]" Then RR = i            '§ä[µo²¼½s¸¹]¤¤³Ì«áªº¤å¦r
  8.     Next
  9.     If RR > R Or R = 0 Or xSNo = 0 Then  '¼Æ¦r¦b¤å¦r¤§«e(©Î¥u¦³¤å¦r),¥u¦³¼Æ¦r
  10.         MsgBox " µo²¼¦³»~ !!!"
  11.    Else
  12.         xSNo = Mid(xSNo, 1, R - 1) & Format(Mid(xSNo,R) + 1, String((y - R + 1), "0"))
  13.     End If
  14.      '¦p  y - R + 1 = 5
  15.      '¦p :Format(568, String((y - R + 1), "0")) => Format(568, "00000") => 5¦ì¼Æ:  00568
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_  Blade
GBKEE µoªí©ó 2012-12-22 16:31


§Ú¦binvoice sheet¥[¤F¤@­Óclick key¡A«Y¥hݯ student sheet ªº¾Ç¥Í¸ê®Æ¡AInputbox¦¨¥\¸õ¥X¨Ó¡A§ÚÁä¤J·|­û½s¸¹«á¡A¨S¦³¸õ¨ì¨º·|­ûªº"¦C"¡A½Ð°Ý¤í¯Ê¤F¬Æ»ò«ü¥O¡H
¥t¥~¨º­ÓInputBox¬O¸õ¨ìstudent sheet¶}±Ò¡A¦pªG§Ú·Q¨º­ÓInputBox°±¯d¦binvoice¡A¨ì§ÚÁä¤J¾Ç¥Í¸ê®Æ«á¡A¤~¸õ¨ìstudent sheet¥i¥H¶Ü¡H
  1. Sub FindStudent()
  2.     Sheets("student").Select
  3.     InputBox ("½Ð¿é¤J¾Ç¥Í ¡£½s¸¹¡¤ ©Î ¡£¦WºÙ¡¤")
  4.     Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
  5.         :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
  6.         False, MatchByte:=False, SearchFormat:=False).Activate
  7.         Exit Sub
  8.         
  9. End Sub
½Æ»s¥N½X

TOP

¦^´_ 26# Blade


Find ¤èªk
³Æµù:
¨C¦¸©I¥s¥»¤èªk«á¡A±NÀx¦s LookIn¡BLookAt¡BSearchOrder ¤Î MatchByte ªº³]©w¡C
¦pªG¤U¤@¦¸©I¥s®É¥¼«ü©w³o¨Ç¤Þ¼Æ¡A±N¨Ï¥ÎÀx¦sªº³]©w¡C
³]©w³o¨Ç¤Þ¼Æ±N§ïÅÜ [´M§ä] ¹ï¸Ü¤è¶ô¤¤ªº³]©w¡A¦Ó­×§ï [´M§ä] ¹ï¸Ü¤è¶ô¤¤ªº³]©w¡A¤]±N§ïÅܨt²Î¦b¬Ù²¤³o¨Ç¤Þ¼Æ®É©Ò¨Ï¥ÎªºÀx¦s­È¡C
¬°ÁקK¥X²{³Â·Ð¡A¨C¦¸©I¥s¥»¤èªk®É¡A½Ð©ú½T«ü©w³o¨Ç¤Þ¼Æªº­È¡C
  1. Option Explicit
  2. Sub FindStudent()
  3.     Dim The_Name As Range
  4.     Sheets("student").Select
  5.     Set The_Name = Cells.Find(InputBox("½Ð¿é¤J¾Ç¥Í ¡£½s¸¹¡¤ ©Î ¡£¦WºÙ¡¤"), LookAt:=xlWhole, MatchCase:=False)
  6.     '°Ñ¼Æ LookAt:=xlWhole    ¦r¦ê¥þ³¡¬Û¦P
  7.     '°Ñ¼Æ MatchCase:= False  ¦r¦ê¤£°Ï¤À¤j¤p¼g
  8.     '
  9.     If Not The_Name Is Nothing Then
  10.         The_Name.Select
  11.     Else
  12.         MsgBox "§ä¤£¨ì¾Ç¥Í: ¡£½s¸¹¡¤ ©Î ¡£¦WºÙ¡¤"
  13.     End If
  14. End Sub
½Æ»s¥N½X

TOP

§Ú¤µ¦¸¤S¹J¨ìÂ÷ÃD¡C
½Ð«ü±Ð
¦­«e¸g¤j¤j«ü±Ð¤U¡A¼g¤F¥H¤U«ü¥O¡C
Rang³¡¤À¡A«ü©w¤FA3:B3¡A¦ý¬O§Ú¤£·Q«ü©wA3:B3¡A¨C¦¸§Ú³£¦Û¤v¿ï¤£¦PRang¡A¨º»ò§ÚÀ³«ç­×§ï¡H
  1. Sub StudentCopy()

  2. Selection.Copy
  3. Range("A3:B3").Select
  4. Sheets("invoice").Select
  5. Range("L7").Select
  6. ActiveSheet.Paste
  7. Application.CutCopyMode = False
  8. Range("K7").Select

  9. End Sub
½Æ»s¥N½X
§Ú¦Û¤v¸Õ­×§ï¦¨³o¼Ë¡A¦ý³£¬O¥X¿ù»~¡C
  1. Range(",").Select
  2.      Selection.Copy
  3.         Sheets("invoice").Select
  4.     Range("L7").Select
  5.     ActiveSheet.Paste
  6.     Application.CutCopyMode = False
  7.     Range("K7").Select
  8. End Sub
½Æ»s¥N½X

TOP

¦^´_ 28# Blade

Range(",").Select
Âù¤Þ¸¹¤º¬OÀx¦s®æªº¦ì¸mA1¤å¦r®æ¦¡
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  Blade

Range(",").Select
Âù¤Þ¸¹¤º¬OÀx¦s®æªº¦ì¸mA1¤å¦r®æ¦¡
GBKEE µoªí©ó 2014-1-16 07:43



  À³¸Ó¬O³o様»¡¡G
  §Ú²{®É¨C¤@¦ì·|­û³£°µ¤F¤@­ÓÁäµ¹¥L­Ì¡A¥u­n«ö¤U¨ºÁä«K·|§âAB·|­û½s¸¹¤Î¦WºÙ¤@¦Pcopy¨ìinvoice¨º­¶ªº¥u©w°Ï¡C
«á¨Óµoı¤H¼Æ¼Wªø¤j¤F¡A§Ú¨S¥i¯à¨C¦ì·|­û¤]µ¹¥L¤@­ÓÁä¡A¦]¦¹§Ú°µ¤F¤@­Ó"¹Ï¤ù"¥k¤W¯»¦âªº¿ï¨úÁä¡A§Ú¥u­n«ü¦V·|­û½s¸¹¦A«öshift¦A¿ï¦WºÙ¡A¤§«á¦A«ö¤U¤@¯»¦âÁä«K¦¨¥\§â·|­û½s¸¹¤Î¦WºÙ¤@¦Pcopy¨ìinvoice¡C
  ¦ý²{¦b§Ú¦w±Æ¤F¥­ªO¹q¸£µ¹«e½u«È¤á±M­û¡A¦pªG¥Î¤â«ü¥h¾Þ±±¡A­n¿ïA½s¸¹¤ÎB¦WºÙ¬O¦³ÃøÃDªº¡A©Ò¥H§Ú·Qªº¤èªk¬O¡A§Ú«ü¦V·Q­nªº·|­û½s¸¹¡A¦ý·í§Ú«ö¤@¤U¿ï¨úÁä¡A«K¯à¦Û°Ê¦a³s¦P·|­û¦WºÙ¤]¤@°_copy¡A¨ìinvoice¡C

¿Ã¹õ§Ö·Ó 2014-01-17 ¤W¤È12.51.46.png (48.76 KB)

¿Ã¹õ§Ö·Ó 2014-01-17 ¤W¤È12.51.46.png

TOP

        ÀR«ä¦Û¦b : ¡i¬O§_µo´§¤F¨}¯à¡H¡j¤H¶¡¹Ø©R¦]¬°µu¼È¡A¤~§óÅã±o¬Ã¶Q¡CÃø±o¨Ó¤@½ë¤H¶¡¡AÀ³°Ý¬O§_¬°¤H¶¡µo´§¤F¦Û¤vªº¨}¯à¡A¦Ó¤£­n¤@¨ý¨Dªø¹Ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD