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

[µo°Ý] ½Ð±Ð¦U¦ì«e½úvba Ãö©ó¤À­¶¼g¤J°ÝÃD~

[µo°Ý] ½Ð±Ð¦U¦ì«e½úvba Ãö©ó¤À­¶¼g¤J°ÝÃD~

¥»©«³Ì«á¥Ñ ii31sakura ©ó 2014-6-3 22:09 ½s¿è

¦U¦ì«e½ú½Ð°Ý¤@¤U¡B¤p§Ì¥Ø«e¥d¦b ¥¨¶°(¤À­¶½T»{)¤¤¦³¥´¤@­Ó°ÝÃDÂIµù¸Ñ¡A
¦¹¬q¥D­n¬°§P©w©Î·s¼W¸Ó¦WºÙ¤À­¶¬O§_¦s¦b¡B¤p§Ì±N³æ¿W¤À­¶¦WºÙ¶ñ¤J¬O¥i¥H°õ¦æªº¡A
¦ý¦pªG¨Ï¥Îfor°j°é¨ÌÄò±NÀɮפÀ­¶(¤H­û²M³æ)¤¤ªº¤À­¶²M³æ¶i¦æ¶ñ¤J±N·|°õ¦æ¿ù»~¡A
½Ð°Ý¦U¦ì«e½ú¤p§Ìªººc·Q¼gªk¤¤¬O­þÃä¥X¤F°ÝÃD©O¡H

·PÁ¦U¦ì¤j¤j¤F~

Àˬd¤u§@­¶TEST.zip (15.25 KB)
µ{¦¡½X¡G
Sub ¤À­¶½T»{()
'For i = 2 To Worksheets("¤H­û²M³æ").[e65536].End(3).Row 'ÅܼÆi ±q2¨ì eÄæ³Ì«á¤@¶µ¸ê®Æ

Workbooks.Open Worksheets("Á`±±¨î").Cells(2, 3) & "\" & Worksheets("Á`±±¨î").Cells(2, 2)
SN = "T001" 'Worksheets("Á`±±¨î").Cells(i, 5)  °ÝÃDÂI
    For Each s In Sheets
        If s.Name = SN Then
            SNN = 1
            Exit For
        Else
            SNN = 0
        End If
    Next
    If SNN = 0 Then
        Sheets.Add
        ActiveSheet.Name = SN
    Else
        Sheets(SN).Select
    End If
   ActiveWorkbook.Close True
'   Next
   
End Sub

¦^´_ 1# ii31sakura
¬O³o¼Ë¶Ü?
  1. Sub ¤À­¶½T»{()
  2.     Dim wb(1 To 2) As Workbook, SN As String, SNN As Integer
  3.     Set wb(1) = ThisWorkbook
  4.     Set wb(2) = Workbooks.Open(Worksheets("Á`±±¨î").Cells(2, 3) & "\" & Worksheets("Á`±±¨î").Cells(2, 2))
  5.     For i = 2 To wb(1).Worksheets("¤H­û²M³æ").[e65536].End(3).Row 'ÅܼÆi ±q2¨ì eÄæ³Ì«á¤@¶µ¸ê®Æ
  6.         SN = wb(1).Worksheets("Á`±±¨î").Cells(i, 5) ' °ÝÃDÂI
  7.         For Each s In wb(2).Sheets
  8.             SNN = 0
  9.             If s.Name = SN Then
  10.                 SNN = 1
  11.                 Exit For
  12.             End If
  13.         Next
  14.         If SNN = 0 Then
  15.             wb(2).Sheets.Add
  16.             ActiveSheet.Name = SN
  17.         Else
  18.             Sheets(SN).Select
  19.         End If
  20.     Next
  21.     wb(2).Close True
  22. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

GBKEE¤j¤j¡B½Ð°Ý¤p§Ì¦b°õ¦æ®É·|¥X²{"°õ¦æ¶¥¬q¿ù»~'1004':À³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~¡A
    ¨Ï¥Î°»¿ù®É·|Åã¥Ü¦b ActiveSheet.Name = SN  ³o­Ó³¡¥÷¡A
    ¯à¤£¯à½Ð³Â·ÐÀ°¦£«üÂI°g¬z¤@¤U©O¡H

¤p§Ì¦b¦¹¥ýÁ¹LGBKEE¤j¤jªºÀ°¦£¤F¡C

TOP

¦^´_ 2# GBKEE

GBKEE¤j¤j ¤£¦n·N«ä¡B­ì¨Ó¬O¤p§Ì¨S§ï¨ì¤@­Ó¦a¤è¡A¤p§Ì¹Á¸Õ±N¤U­±³o­Ó¦a¤è§ó§ï«á¥\¯à´N¥¿±`°õ¦æ¤F¡A
·PÁ GBKEE¤j¤j ªºÀ°¦£¸Ñµª®@~

µù¡GSN = wb(1).Worksheets("Á`±±¨î").Cells(i, 5) ' °ÝÃDÂI ¡÷§ï¦¨ SN = wb(1).Worksheets("¤H­û²M³æ").Cells(i, 5) ' °ÝÃDÂI

TOP

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