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

[µo°Ý] ±N¦h­ÓEXCEL ¶×¨ì¤@­ÓEXCELªº°ÝÃD

[µo°Ý] ±N¦h­ÓEXCEL ¶×¨ì¤@­ÓEXCELªº°ÝÃD

¥»©«³Ì«á¥Ñ yanto913 ©ó 2012-4-14 10:30 ½s¿è

½Ð¨£ªþÀÉ
±NÀɮשñ¨ìC:\¼Ñ

¦¹¸ê®Æ§¨¤º¦³¤­­ÓEXCEL¤À§O¬O1.xls~5.xls
°õ¦æall.xls¶×¤J1.xls~5.xls
²{ªp¬O¨S°ÝÃD

¦ý¬O§Ú·Q½Ð±Ðªº¬O¦pªG¤¤¶¡¦³¯ÊÀÉ·|²£¥Í¿ù»~(°²³]¯Ê1.xls, 3.xls, 4.xls)
¬d¾\ºô¯¸¦³»¡­n¥Îon error goto
¦ý¬O¿ù»~¦n¹³¥u¯à¸õ¹L¤@¦¸¡A²Ä¤G¦¸ÁÙ¬O·|¥X²{¿ù»~

¥t¥~Âà¥X®É¤]·|¥X²{°ÝÃD
¦]¬°§Ú¤£·|§PÂ_°}¦C¬°±q²Ä¤G­Ósheet(2)~³Ì«á¤@­Ó¶×¥X

Àµ½Ð¦U¦ì¥ý¶i½ç±Ð   ÁÂÁÂ

°ÝÃDÁ|¨Ò1.rar (17.86 KB)

YOYO

¦^´_ 1# yanto913

¥i§_§â on error goto §ï¦¨ on error resume next ¸Õ¸Õ¬Ý?

TOP

¦^´_ 2# LeafYeung


©êºp,§Ú¸Õ¤£¥X¨Ó­C!!
on error resume next
À³¸Ó©ñ¦b­þ¸Ì©O??
YOYO

TOP

¦^´_ 3# yanto913

§Ú¤£¯à¤U¸ü§Aªº file~~ ³o¸Ì¦³­Ó On Error ¥Îªk ªº¨Ò¤l...§A¥i¥H¬Ý¬Ý.....(ref. " followme excel 2007 vba")

Sub On_Error_¥Îªk1()
    Dim StBase As String, myInc As Integer
    Dim mySheet As Worksheet
   
    Set mySheet = Worksheets.Add
    StBase = "´ú¸Õ"
    myInc = 1
'   On Error Resume Next
    mySheet.Name = StBase & myInc
    Do Until Err.Number = 0
        Err.Clear
        myInc = myInc + 1
        mySheet.Name = StBase & myInc
    Loop
End Sub

TOP

¦^´_ 4# LeafYeung


    on error resume next ­è­è¥Î¤F¤@¤U,¥i¥H¥Î
¦ý¥Î¤FÅܦ¨¥þ³¡©¿²¤
¦ý§Ú¬O¤ñ¸û·Q­n¦pªG¿ù»~¸õ¨ì¬Y¦æ°õ¦æ©Ò¥H¤~·Q¥Îon error go to
¦ý¬OÅܦ¨°õ¦æ²Ä¤G¦¸¿ù»~´NµLªk¸õ¹L¿ù»~¤F
YOYO

TOP

¦^´_ 5# yanto913


¥i§_ email µ¹§Ú¬Ý¬Ý... [email protected]   

ÁÂÁÂ...

TOP

¦^´_ 1# yanto913
  1. Sub test()
  2. Dim sht()
  3. Application.ScreenUpdating = False 'Ãö³¬¿Ã¹õ§ó·s
  4. fd = ThisWorkbook.Path & "\" 'ÀɮשҦb¥Ø¿ý
  5. fs = fd & "*.xls"
  6. fb = Dir(fs)
  7. Do Until fb = "" '©Ò¦³xlsÀÉ®×°j°é
  8. If fb <> ThisWorkbook.Name Then
  9. With Workbooks.Open(fd & fb)
  10.    Set sh = .Sheets(1)
  11.    ReDim Preserve sht(s) '°O¦í©Ò¦³¤u§@ªí¦WºÙ
  12.    sht(s) = sh.Name
  13.    s = s + 1
  14.    sh.Copy after:=ThisWorkbook.Sheets(1) '½Æ»s¤u§@ªí
  15.    .Close 0 'Ãö³¬ÀÉ®×
  16. End With
  17. End If
  18. fb = Dir
  19. Loop
  20. Sheets(sht).Move '²¾°Ê©Ò¦³½Æ»sªº¤u§@ªí¨ì·sÀÉ®×
  21. Application.ScreenUpdating = True '«ì´_¿Ã¹õ§ó·s
  22. End Su
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# Hsieh




    ÁÂÁÂHsieh ª©¥D

½Ð°Ý¦pªG§Ú¥u·Q­n§âsheets("all")¤¤A1~A5¬°ÀɦW¥h·j´Mxls
¦Ó¥B·j´M¨ìªº¦bsheets("all")¤¤B1~B5¼Ð¥Ü"OK"¸Ó¦p¦ó°µ©O?
YOYO

TOP

¦^´_ 8# yanto913


    ¬Ý§AA1:A5ªºÀɦW¼Ë¦¡¬°¦ó?¬O§_¥]§t¸ê®Æ§¨¥Ø¿ý©Î°ÆÀɦW
¤£¦P¸ê®Æ¦³¤£¦P³B²z¤è¦¡¡A¥H¼Ó¤Wªºµ{¦¡½X¥h¥[§PÂ_¦¡À³¸Ó¤£¬O«ÜÃøªº
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 9# Hsieh

Hsieh ª©¥D
½Ð°Ý¥H¤Uµ{§Ç¦b°õ¦æ²Ä¤G¦¸ on error goto ®É ¬°¦ó·|¥X²{ error ©O??

Sub test1()
For i = 1 To 10
On Error GoTo AAA '¿ù»~®É¸õ¦Ü
B = i / 0 '»s³y¿ù»~
AAA:
On Error GoTo 0
Next
End Sub

·í i=1®É´N¥i¦æ,¦ý·íi=2®É´N error
·Ð½Ð±Ð¾É~~ÁÂÁÂ

TOP

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