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

[µo°Ý] ÃöÁä¦r§ì¹Ï¤ù

[µo°Ý] ÃöÁä¦r§ì¹Ï¤ù

½Ð°Ý¤@­Ó¸ê®Æ§¨¸Ì­±¦³«Ü¦hªº¹Ï¤ù
§Ú±qC2¶}©l¿é¤JÀɦW
¦ý§Ú¥uª¾¹DÃöÁä¦r
¨Ò¦p:ABCD123456  §Ú¥u¿é¤JABCD
³o¼Ë¤]¯à§ì¨ì¹Ï¤ù
¤U­±ªºµ{¦¡½X­þ¸Ì¦³¿ù¶Ü
³Â·Ð¦U¦ì~À°§Ú¬Ý¤@¤U
Sub Macro1()
    j = 2
    MyPath = "C:\My Pictures\"
    MyFile = Dir(MyPath & Cells(j, "C") & "*.jpg")
    While Cells(j, "C") <> ""
        NN = Cells(j, "C")
        Cells(j, "D").Select
        On Error Resume Next
        ActiveSheet.Pictures.Insert(MyFile).Select
        Selection.ShapeRange.LockAspectRatio = msoTrue
        Selection.ShapeRange.Height = 100#
        Selection.ShapeRange.Width = 100#
        Selection.ShapeRange.Rotation = 0#
        With Selection
        .Placement = xlMoveAndSize
        .PrintObject = True
        End With
    j = j + 1
    Wend
    Range("C2").Select
End Sub

¦^´_ 6# GBKEE
¤£¦n·N«ä
§Ú·Q­nªº¥¿¦n¬O¬Û¤Ïªº
°²³]ÀɦW¬°ABCD123456.jpg
§Ú¦bC2¿é¤JABCD
D2¯àÅã¥ÜABCD123456.JPGªº¹Ï¤ù

TOP

¦^´_ 9# c_c_lai
À°§Ú¬Ý¤@¤U
§Ú·Q­n¦bAÄæBÄæ©ñ¦ì§}
CÄ欰¹Ï¤ùÀɦW
DÄ欰Åã¥ÜAªº¹Ï¤ù
EÄæÅã¥ÜBªº¹Ï¤ù
¨Ï¥ÎFOR °j°é
¹Ï¤ù·|¦bDÄæ­«Å|
¸Ó«ç»ò§ï©O
     Option Explicit

    Sub Ex()
        Dim j As Integer, MyPath As String, MyFile As String, k, l

        For k = 1 To 2
           For l = 4 To 5
          j = 2
        While Cells(j, "C") <> "" 'C2¬°ÀɦW
         MyPath = Cells(j, k)  'A2 B2¬°¦ì§}
            If UCase(Cells(j, "C")) Like "*W*" Then  '¦r¦ê¤¤¦³"ABCD"
               '  UCase ¨ç¼Æ ¶Ç¦^¤@­Ó Variant (String)¡A©Ò§t¬°Âন¤j¼g¤§¦r¦ê¡C
                Cells(j, l).Select   'D2 E2¬°¹Ï¤ù
                On Error Resume Next
                MyFile = Dir(MyPath & "*" & Cells(j, "C") & "*.*")       '  C2 = "ABCD" ->"1AABCD.png"

                If MyFile <> "" Then
                    With ActiveSheet.Pictures.Insert(MyPath & MyFile)
                        '  .ShapeRange.LockAspectRatio = msoTrue
                        '  ¦b½Õ¾ã¹Ï®×¤j¤p®É¡A¥i¥H¤À§O¦a½Õ¾ã¹Ï®×ªºªø«×©M¼e«×
                        .ShapeRange.LockAspectRatio = msoFalse
                        .ShapeRange.Height = 100#
                        .ShapeRange.Width = 100#
                        .ShapeRange.Rotation = 0#
                        .Placement = xlMoveAndSize
                        .PrintObject = True
                    End With
                End If
            End If
            j = j + 1
        Wend
        Range("C2").Select
        Next
        Next
    End Sub

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD