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

[µo°Ý] ¨D§U«Ø¥ß°j°éÀ³¥Î

¦^´_ 12# linsurvey2005

³o¥ySourceWb.Close 0  ¬O¥Î¨ÓÃö±¼  ¶}±ÒªºÀɮ׶Ü?

SourceWb.Close 0 -> SourceWb.Close False ( ÀÉ®×Ãö³¬:  ¤£Àx¦sÀÉ®×)
SourceWb.Close 1 -> SourceWb.Close True   (ÀÉ®×Ãö³¬:  Àx¦sÀÉ®×)

¦^´_ 13# linsurvey2005

·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 11# Hsieh


¦Ñ®v¦n
°õ¦æ¸ê®Æ¿ï¨úªº®É­Ô¡A«öctrl+"A1:E50","G1:H50"
¸ê®ÆÅã¥Ü¦X¨Ö¬°A1:C50,G1:H50(D1:E50ªº¸ê®Æ¤w³QG1:H50»\¹L)
§Ú·QÅý¸ê®Æ¦X¨Ö¬°A1:E50,G1:H50
À°¦£¸Ñ´b
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

¦nÆg~³oºØ¦³±ÐµL²\ªººë¯«(¤­Åé§ë¦a)
µ{¦¡½Xªº®ÄªG¦³¦p99.99¯Âª÷
À~¦º§Ú¤F~¤Ó±j¤F
¦A¦¸¸ß°Ý
If TypeName(k) = "Boolean" Then SourceWb.Close 0: Exit Sub
³o¥ySourceWb.Close 0  ¬O¥Î¨ÓÃö±¼  ¶}±ÒªºÀɮ׶Ü?

myfilename = Format(Date, "yymmdd") & "-Tilt-PDA.xls"
­ì¨Ó¥y¤l³o¼Ë¤l´N¥i¥H¤F
µ¥§Ú¿n¤À¥R¨¬§Ú´N¥h¤U¸ü¦Ñ®vªº"¤@¨Çvba±`¥Î»yªk½d¨Ò"
±µÄ²VBA§Ö2¦~¤F¨S°ò¥»©³¤l
«Ü¦hªF´ê¦è´êªºµ{¦¡½X
¸Ó¬O­n¥¿­±±µÄ²ªº®É­Ô¤F
¥[¤J½×¾Â«Ü¶}¤ß
·PÁ¦Ѯv¤£§[«ü¾É
¥H¤W
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

¦^´_ 10# linsurvey2005

¸Õ¸Õ¬Ý³o¼Ë¬O¤£¬O§A­nªº
  1. Sub Selection_Copy()
  2. Dim fs$, SRng, SourceWb As Workbook
  3. fs = Application.GetOpenFilename("Excel ÀÉ®×(*.xls),*.xls")
  4. Set SourceWb = Workbooks.Open(fs)
  5. k = Application.InputBox("½Ð¿ï¨ú±ý½Æ»sªº½d³ò", , , , , , , 8)
  6. If TypeName(k) = "Boolean" Then SourceWb.Close 0: Exit Sub
  7. Set nwb = Workbooks.Add
  8. With nwb.Sheets(1)
  9. .Activate
  10. r = Application.Max(12, .Cells(.Rows.Count, 1).End(xlUp).Row + 1)
  11. If IsArray(k) Then
  12. .Cells(r, 1).Resize(UBound(k, 1), UBound(k, 2)) = k
  13. Else
  14. .Cells(r, 1) = k
  15. End If
  16. yn = MsgBox("¬O§_Ä~Äò", vbYesNo): GoTo 10
  17. Do Until yn <> 6 Or TypeName(k) = "Boolean"
  18. r = Application.Max(12, .Cells(.Rows.Count, 1).End(xlUp).Row + 1)
  19. If IsArray(k) Then
  20. .Cells(r, 1).Resize(UBound(k, 1), UBound(k, 2)) = k
  21. Else
  22. .Cells(r, 1) = k
  23. End If
  24. yn = MsgBox("¬O§_Ä~Äò", vbYesNo)
  25. 10
  26. If yn = 6 Then SourceWb.Activate: k = Application.InputBox("½Ð¿ï¨ú±ý½Æ»sªº½d³ò", , , , , , , 8)
  27. Loop
  28. nwb.Activate
  29. DoEvents
  30. myfilename = Format(Date, "yymmdd") & "-Tilt-PDA.xls"
  31. Application.SendKeys myfilename, True
  32. sf = Application.GetSaveAsFilename("E:\")
  33. If sf <> False Then nwb.SaveAs sf
  34. SourceWb.Close 0
  35. End With
  36. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP


©çÁÂ~§Úªº°ÝÃDÅÞ¿èµ²ºc¤£°÷¨ãÅé³y¦¨"¸£³U¥´µ²"~^.^
ÁÙ¬O§Úµ¹¦Ñ®v¬Ý¥þ³¡ªºµ{¦¡½X ³o¼Ë¤ñ¸û¤£·|µ§»~~^.^
Sub testall()
    F = Application.GetOpenFilename("Excel ÀÉ®×(*.xls),*.xls")
       If F = "False" Then Exit Sub
         Workbooks.Open filename:=F
            y = ActiveWorkbook.Name         
    Dim mtstr As String, Wb As Workbook
    On Error Resume Next
      myStr = "¿ï¨ú¸ê®ÆOK«á«ö½T©wÁä"
    Set k = Application.InputBox(myStr, Type:=8)  'data½d³ò
         If Err Then Exit Sub
           Set Wb = Workbooks.Add    '¶}±Ò·s¬¡­¶Ã¯
    ThisWorkbook.Activate
         k.Copy Wb.ActiveSheet.[A3]
           Set k = Nothing'ÄÀ©ñª«¥ó
              Response = MsgBox("¬O / §_Ä~Äò¿ï¨ú", vbYesNo)
    Do Until Response <> vbYes
        Windows(y).Activate'¦^¨ì­ì¿ï¨úÀÉ®×Ä~Äò¿ï¨ú
           Set k = Application.InputBox(myStr, Type:=8) 'data½d³ò
             k.Copy Wb.ActiveSheet.[A65536].End(xlUp).Offset(1, 0) '«ü©wÀx¦s®æ ¶K¤W¸ê®Æ
           Set k = Nothing'ÄÀ©ñª«¥ó
             Response = MsgBox("¬O / §_Ä~Äò¿ï¨ú", vbYesNo)
    Loop
   
    Application.DisplayAlerts = False'Ãö³¬°T®§Äæ   
       Windows(y).Close' Ãö³¬¿ï¨ú¸ê®ÆÀÉ®×
    Application.DisplayAlerts = True'¶}±Ò°T®§Äæ
   
   Application.ScreenUpdating = False
        Windows(Wb).Activate 'Åã¥Ü¨ì·s¬¡­¶Ã¯ÀÉ®×µe­±
        Windows("book1".xls).Activate   '¤W­±¨º¦æ¥i¥H¼g¦¨³o¼Ë¹À?  
Dim nX As Long, X As Long, I As Integer'¥H¤U¬O¦b·s¬¡­¶Ã¯°õ¦æ
    nX = [A65536].End(xlUp).Row
    For X = nX To 4 Step -1
      For I = 1 To 3
       Rows(X).Insert
      Next
    Next
    bb = (nX - 1) * 4 - 1
    cc = 65536
    Rows(bb & ":" & cc).Clear
    Columns("n") = Columns("n").Value'¥uÅã¥Üªí®æ¸ê®Æ
    Application.Dialogs(xlDialogSaveAs).Show (Format(Date, "yymmdd" & "-Tilt") & "-PDA" & ".xls")'¥t¦s·s¬¡­¶Ã¯ÀɦW
   Windows("µ{¦¡ÀÉ").Close'Ãö³¬¥¨¶°¼¶¼gÀÉ®×(¦]¬°§Ú¨Ï¥Î¥¨¶°¤p«ö¶s«ü©w¥¨¶°¨Ó±Ò°Ê)À³¸Ó¬O¦Ñ®v»¡ªº"µ{¦¡ÀÉ"¬Ò¦A¤U¼h°õ¦æ¤£­nÅã¥Üª¬ºA
End Sub
¥H¤W ³Â·Ð¦Ñ®vÀ°§Ú«ü¥¿~¾ÇµL¤îºÉ,¾i¥Í¥­©Ê~^.^
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

¦^´_ 8# linsurvey2005

¤w¸g³Q§A¥´±Ñ¤F
³Q§Aªº»¡©ú·dªº¸£³U¥´µ²¤F
­º¥ý§A¥u­n½T©w§A­nÂI¿ï¬O­þ­ÓÀÉ®×?
ÂI¿ï«á½Æ»s¨ì­þ­ÓÀÉ®×?
³Ì²³æ´N¬O§â³o¨ÇÀɮצb¶}±Ò®É¥ÎÅܼƨÓÀx¦s´N¯à¦b«áÄò°Ê§@«ü©w¨ì¥¿½TÀÉ®×
¦A¥Î°j°é¨Ó¶}±ÒÂI¿ïµ¡®æ(inputbox)¡A»PÄ~Äò»P§_ªº¹ï¸Ü(msgbox)
²M·¡¤F¸Ñ§A·Q­nªº°Ê§@¶¶§Ç´N¯à§¹¦¨  
¦]¬°¤§«eªº»yªk¤w¸g¥]§t¤F¶}±Ò·sÀÉ¡A±NÀɮ׫ü©wµ¹ª«¥óÅܼơA  °j°éÂI¿ï½Æ»s
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦Ñ®v¥i¥H¦A«ü¾É¤@¤U¹À?
¦n´Á«Ý¤º
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

·PÁ¦Ѯv¤£§[«ü¾É,¥¦¤s¤§ªk
§Ú¦A¦¸¼W¥[¤F¶}Àɦæ¦C
Ä~Äò¿ï¨ú¸ê®Æ´NÅã¥Ü¨ì¿ï¨úªº¬¡­¶Ã¯
¦pªGµ²§ô¿ï¨ú´NÅã¥Ü¨ì·sªº¬¡­¶Ã¯
¦]¥¨¶°¬O¦b¥t¥~¤@­ÓExcelÀɮ׫إß(µ{¦¡ÀÉ.xls)
³Ì¥D­n¬O§Æ±æ¹B§@®É¤£­n½s¿è¨ì(µ{¦¡ÀÉ.xls)
¦ý¬O·s¼W³¡¤À´N¬O¤£·|Åã¥Ü¨ì"·s¬¡­¶Ã¯"
½Ð¦Ñ®vÀ°¦£«ü¾É

Sub testopen()
    F = Application.GetOpenFilename("Excel ÀÉ®×(*.xls),*.xls")
    If F = "False" Then Exit Sub
        Workbooks.Open filename:=F
            y = ActiveWorkbook.Name
        
    Dim mtstr As String, Wb As Workbook
    On Error Resume Next
        myStr = "¿ï¨ú¸ê®ÆOK«á«ö½T©wÁä"
    Set k = Application.InputBox(myStr, Type:=8)  'data½d³ò
    If Err Then Exit Sub
        Set Wb = Workbooks.Add    '¶}±Ò·s¬¡­¶Ã¯
            ThisWorkbook.Activate
                Wb = ActiveWorkbook.Name            
            k.Copy Wb.ActiveSheet.[A3]
        Set k = Nothing
        Response = MsgBox("¬O / §_Ä~Äò¿ï¨ú", vbYesNo)
    Do Until Response <> vbYes
Windows(y).Activate        
       Set k = Application.InputBox(myStr, Type:=8) 'data½d³ò
            k.Copy Wb.ActiveSheet.[A65536].End(xlUp).Offset(1, 0) '«ü©wÀx¦s®æ ¶K¤W¸ê®Æ
        Set k = Nothing
            Response = MsgBox("¬O / §_Ä~Äò¿ï¨ú", vbYesNo)
    Loop
   
    Application.DisplayAlerts = False
        Windows(y).Close
    Application.DisplayAlerts = True
    Application.ScreenUpdating = False

Windows(Wb).Activate  
.........
.......
....
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

·í·sªº¬¡­¶Ã¯¶}±Ò®É¡A§@¥Î¤¤¬¡­¶Ã¯·|«ü¦V¸Ó·s¼Wªº¬¡­¶Ã¯
ThisWorkbook.Activate
½T«O§@¥Î¤¤¬¡­¶Ã¯·|¬Oµ{¦¡½X©Ò¦b¤§¬¡­¶Ã¯
¦¹®É·s¬¡­¶Ã¯¤´µM¬OÅã¥Üªº¡A¥u¬OÅã¥Ü¦b¤U¤@¼hµøµ¡

Set k = Nothing
¦b³oÃä¬O¥²¶·ªº¡A·í¹ï¸Ü®Ø¿ï¾Ü°Ê§@·|³y¦¨µ{¦¡¥X¿ù®É
¦]«e­±ªºOn Error Resume Next·|Åýµ{§ÇÄ~Äò°õ¦æ¡A­Y¤£ÄÀ©ñkª«¥ó
µ{¦¡¦bµ²§ô®É¥i¯à·|¦h¶K¤@¦¸¥¼ÄÀ©ñªºkª«¥ó
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

·PÁ¦Ѯvªº¦A¤T¦^ÂÐ
½Ð±Ð¥H¤U´X¦æ¬O¤£¬OÅýª«¥ó¥Ñ"K"µe­±(Åã¥Üª¬ºA)±a¥X¸ê®Æ«á
´¡¤J·s¬¡­¶Ã¯(ÁôÂꬺA),³o¼Ë¬O´£°ª§@·~®Ä²vªº¤@ºØ¶Ü?
¥t¥~¹ï"K"ª«¥óÄÀ©ñ,¬O¤£¬O¨¾¤î¸ê®Æ¦h ¹q¸£·|¥d¥dªº.
¤£¦n·N«ä°ÝÃD¤ñ¤s°ª~^.^
Set Wb = Workbooks.Add    '¶}±Ò·s¬¡­¶Ã¯
ThisWorkbook.Activate
k.Copy Wb.ActiveSheet.[A3]
Set k = Nothing
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD