| ©«¤l95 ¥DÃD29 ºëµØ0 ¿n¤À150 ÂI¦W0  §@·~¨t²Îwindows2003 ³nÅ骩¥»office 2003 ¾\ŪÅv20 ©Ê§O¨k ¨Ó¦ÛKaoshiung µù¥U®É¶¡2010-11-5 ³Ì«áµn¿ý2018-2-8 
 | 
[µo°Ý] ½Ð±Ð,¦p¦ó³v¤@¶}±Ò¤l¸ê®Æ§¨¤º¤§¤å¦rÀɦÜEXCEL 
| Dear ¦U¦ì¤j¤j : ¥i§_½Ð¦U¦ìÀ°¦£¬Ý¤@¤U,MYFNAME¤w§ä¨ì¤l¸ê®Æ§¨¤§¤å¦rÀÉ,¦ý«o¶}¤£°_¨ÓµLªk³v¤@¿é¤J,ÁÂÁÂ!
 ½Æ»s¥N½XPublic dic
Sub ListFi()
Dim mypath As String
Dim theSh As Object, E As Object, theFolder As Object
Dim i As Integer
    
'Application.ScreenUpdating = False
On Error Resume Next
    Set theSh = CreateObject("shell.application")
    Set theFolder = theSh.BrowseForFolder(0, "", 0, "")
    If Not theFolder Is Nothing Then
        mypath = theFolder.Items.Item.Path
        'MsgBox mypath
    End If
    
    With CreateObject("Scripting.FileSystemObject").GetFolder(mypath)
        i = 1
        For Each E In .SubFolders
            If i > ActiveWorkbook.Sheets.Count Then
                Sheets.Add(, Sheets(Sheets.Count)).Name = E.Name
            Else
                Sheets(i).Name = E.Name
            End If
            '--------------------------------------------
    
        Dim MyTEXT As String, MYFNAME As String, WAFERID As String, ROWDATA_START As String
        Dim EE As Integer, FILENO As Integer
        
        'fs = Dir(fd & "*.txt")
                    EE = 4
                    On Error Resume Next
                    FILENO = FreeFile
                    MsgBox E.Name
                    fd = E & "\"
                    MYFNAME = Dir(fd & "*.txt")
                    'MYFNAME = Dir(E & "\", MacID("TEXT"))
                    If MYFNAME = "False" Then Exit Sub
                    Open MYFNAME For Input As #FILENO
                            WAFERID = "WAFER:"
                            ROWDATA_START = "RowData:"
                            'DEVICE = "DEVICE:"
                            'LOT = "LOT:"
                    'COLCT = "COLCT:"
                        Do While Not EOF(1)
                            Input #FILENO, MyTEXT
                                'If Mytxt Like DEVICE & "*" Then
                                    'Cells(1, 1).Value = MyTEXT
                                'End If
                                'If Mytxt Like LOT & "*" Then
                                    'Cells(2, 1).Value = MyTEXT
                                'End If
                                If Mytxt Like WAFERID & "*" Then
                                    Cells(3, 1).Value = MyTEXT
                                End If
                                 'If MYTXT Like COLCT & "*" Then
                                    'Cells(4, 1).Value = MYTXT
                                'End If
                                If Mytxt Like ROWDATA_START & "*" Then
                                    Cells(EE + 1, 1).Value = MyTEXT
                                    EE = EE + 1
                                End If
                        Loop
                    Close #FILENO
'----------------------------------------------------------
            ii = 12
           For Each P In E.Files
                '------------------------------------------
                   If InStr(UCase(P.Name), ".JPG") Then
                        ActiveWindow.Zoom = 70
                        Worksheets(i).Activate
                        '--³]©w¹Ï¤ùÄæ¦ì¤j¤p
                        With Sheets(i).Cells(ii, 2).Select
                            With Selection
                            .RowHeight = 82
                            .ColumnWidth = 17
                            .WrapText = True
                            End With
                            '--³]©w¹Ï¤ù¦ì¸m¤Îªø¼e
                            t = Cells(ii, 2).Top + Cells(ii, 2).Height * 0.04  '¹Ï¤ù¤W¦ì¸m
                            L = Cells(ii, 2).Left + Cells(ii, 2).Width * 0.04 '¹Ï¤ù¥ª¦ì¸m
                            w = 75                                       '¹Ï¤ùÁY¤p75%¼e«×
                            h = 75                                  '¹Ï¤ùÁY¤p75%°ª«×
                            '--¶}©l´¡¤J¹Ï¤ù
                                With Sheets(i).Shapes.AddPicture(P, True, True, L, t, w, h)
                                .Placement = xlMove
                                        With Sheets(i)
                                        .Cells(ii, 1) = P.Name                          '¹Ï¤ùÀɮצWºÙ
                                        '.Cells(ii, 1) = P                              '¹Ï¤ùÀÉ®×§¹¾ã¸ô®|
                                        End With
                                End With
                            End With
                        ii = ii + 1    '¤@¦¸¸õªºÄæ¦ì¼Æ
                    
                End If   '--get .jpg file
            Next
            
            i = i + 1
        Next
    End With
    'Sheets.Add After:=Sheets(Sheets.Count)
    
End Sub
Sub nn()
With ActiveSheet.Shapes(Application.Caller)
    If .Left = ActiveSheet.[A1].Left Then
        .Top = dic(.Name)(0)
        .Left = dic(.Name)(1)
        .Height = dic(.Name)(2)
        .Width = dic(.Name)(3)
    Else
        .Height = dic(.Name)(2) * 3
        .Width = dic(.Name)(3) * 3
        .Top = ActiveSheet.[A1].Top
        .Left = ActiveSheet.[A1].Left
        '.ZOrder msoBringToFront
    End If
End With
End Sub
 000-Start.zip (18.29 KB) | 
 |