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

´¡¤J¹Ï¤ù®É¡Aµ¥¤ñ¨Ò©ñ¤j©ÎÁY¤p

´¡¤J¹Ï¤ù®É¡Aµ¥¤ñ¨Ò©ñ¤j©ÎÁY¤p

½Ð±Ð´¡¤J¹Ï¤ù¨ìÀx¦s®æ½d³ò®É¡A¦p¦óµ¥¤ñ¨Òªº¦bÀx¦s®æ½d³ò¤º©ñ¤j©ÎÁY¤p
¥H¤Uµ{¦¡½X¬°¹Ï¤ù¤j¤p²Å¦XÀx¦s®æ¡AÀ³¦p¦ó­×§ï©O¡H

    i = ThisWorkbook.Path & "\" & NewRef & ".jpg"
    X = Dir(ThisWorkbook.Path & "\" & NewRef & ".jpg")
       If X <> "" Then
          Set rngs = Range(Cells(61, 2), Cells(61, 19))
          ActiveSheet.Shapes.AddPicture i, True, True, rngs.Left, rngs.Top, rngs.Width, rngs.Height
       Else
      End If

ÁÂÁÂ~~

«Øij¼W¥[«Å§i:
  1. Dim NewPicture as Object
½Æ»s¥N½X
  1. i = ThisWorkbook.Path & "\" & NewRef & ".jpg"
  2.     X = Dir(ThisWorkbook.Path & "\" & NewRef & ".jpg")
  3.     If X <> "" Then
  4.         Set Rngs = Range(Cells(61, 2), Cells(61, 19))
  5.         Set NewPicture = ActiveSheet.Pictures.Insert(i)
  6.         With NewPicture
  7.             .ShapeRange.LockAspectRatio = msoTrue
  8.             .Left = Rngs.Left
  9.             .Height = Rngs.Height
  10.             If .Width > Rng.Width Then
  11.                 .Width = Rng.Width
  12.                 .Top = Rngs.Top + (Rngs.Height - .Height) / 2
  13.             Else
  14.                 .Top = Rngs.Top
  15.             End If
  16.         End With
½Æ»s¥N½X

TOP

¦^´_ 2# ikboy


    ·PÁÂikboy¤j¤j¦^ÂСA
    ¸g´ú¸Õ«áµo²{¹Ï¤ù¦³¦bÀx¦s®æ¤ºµ¥¤ñ¨Ò©ñ¤j¡A¦ý¦ü¥G·|°±¦b10~15ªº³o­Ó°j°é¥X¤£¨Ó(¦]¬°µ¥¤ñ¨Ò©ñ¤j«áªº¹Ï¤ù¼e«×ÁÙ¬O¤ñÀx¦s®æ½d³ò¤p)¡A
    §Ú¸ÕµÛ¦b²Ä13¦æ´¡¤JExit Sub¡A¤]¨S¦³¥Î¡A½Ð°Ý¸Ó¦p¦ó­×¥¿¡H
    ¥t¥~­n¥[¤W¤°»ò«ü¥O¥i¥H±Nµ¥¤ñ¨Ò©ñ¤j«áªº¹Ï¤ù¦bÀx¦s®æ½d³ò¤º¸m¤¤©O¡H
    ÁÂÁÂ~~

TOP

§Ú¬O°ò©ó§Aªº¥N½X­×§ï, ¥¼°Ñ»P°j°é³¡¥÷, ¤£¾å±o°ÝÃD©Ò¦b¡C

TOP

¦A¬Ý³o¤@¥y (¦]¬°µ¥¤ñ¨Ò©ñ¤j«áªº¹Ï¤ù¼e«×ÁÙ¬O¤ñÀx¦s®æ½d³ò¤p) «á, ²´·ú°¨¤W@@, ¸£¸Ì??¶Ã­¸, ¨ì©³§A­n¹Ï¤ù­è¶ñº¡Àx¦s®æ©Î¹Ï¦Û¨­ªø¼e«ö¬Û¦P¤ñ¨ÒºÉ¶q©ñ¤JÀx¦s®æ¤¤?

TOP

¥»©«³Ì«á¥Ñ takeshilin88 ©ó 2020-9-29 15:21 ½s¿è

¦^´_ 5# ikboy

ikboy¤j¤j±z¦n¡G

¬O¡u¹Ï¦Û¨­ªø¼e«ö¬Û¦P¤ñ¨ÒºÉ¶q©ñ¤JÀx¦s®æ¤¤¡v
±z´£¨Ñªº«ü¥O¦³±N¹Ï¤ù©ñ¤j¡A¦ý¦]¬°Àx¦s®æ½d³ò¤ñ¸û¼e¡A©Ò¥H¹Ï¤ùÁٻݭn¥ª¥k¸m¤¤
ÁÂÁÂ

TOP

¥Ñ©ó°N¬O¥N½X¤ù¬q­×¥¿®×, µLªk´ú¸Õ, ¤W¦¸¥N½X¤¤ªºRngs, ¤í¤F"s" ¤Î¨S¦³ End if, ¦¹¦¸¤@¦P­×¥¿¡C
  1. i = ThisWorkbook.Path & "\" & NewRef & ".jpg"
  2.     X = Dir(ThisWorkbook.Path & "\" & NewRef & ".jpg")
  3.     If X <> "" Then
  4.         Set Rngs = Range(Cells(61, 2), Cells(61, 19))
  5.         Set NewPicture = ActiveSheet.Pictures.Insert(i)
  6.         With NewPicture
  7.             .ShapeRange.LockAspectRatio = msoTrue
  8.             If .Height / .Width >= Rngs.Height / Rngs.Width Then
  9.                 .Height = Rngs.Height
  10.                 .Top = Rngs.Top
  11.                 .Left = (Rngs.Width - .Width) / 2 + Rngs.Left
  12.             Else
  13.                 .Width = Rngs.Width
  14.                 .Left = Rngs.Left
  15.                 .Top = (Rngs.Height - .Height) / 2 + Rngs.Top
  16.             End If
  17.         End With
  18.     End If
½Æ»s¥N½X

TOP

¦^´_ 7# ikboy


    ·PÁÂikboy¤j¤j¡A
    ¤w¸g¦¨¥\¤F¡A
    ½Ð±Ð³o¸ÌªºIfªº§PÂ_¬O¨Ì·Ó¤°»ò±ø¥ó¡A¦³ÂI¤£¤Ó²z¸Ñ?? °ª / ¼e
    If .Height / .Width >= Rngs.Height / Rngs.Width Then

    ·P®¦~~

TOP

¨º¬O­pºâÀx¦s®æ»P¹Ï¤ù°ª¼e¤ñ, ¿ï¥X¾A¦Xªº°ª©Î¼e§@¬°¹Ï¤ùªº°ò¦µM«á......

TOP

¦^´_ 9# ikboy


    ­ì¨Ó¦p¦¹¡A¤S¾Ç¨ì¤F¤@©Û¡A¦A¦¸·PÁÂ~~

TOP

        ÀR«ä¦Û¦b : ¤H¨ÆªºÁ}Ãø»PµZ¿i¡A´N¬O¤@ºØ¦ÒÅç¡C
ªð¦^¦Cªí ¤W¤@¥DÃD