Results 1 to 1 of 1

Thread: Insert Pictures From Multiple Sheet in Any Cell Then Auto fit Resize

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Posts
    3
    Rep Power
    0

    Insert Pictures From Multiple Sheet in Any Cell Then Auto fit Resize

    hi expert..

    this code below working well to insert picture then automatic resize in a cell but unfortunally this code only work in the same sheet
    i want to make how this code work between several sheet..
    here this code :
    Code:
    Public Sub FitPic()
    On Error GoTo NOT_SHAPE
    Dim PicWtoHRatio As Single
    Dim CellWtoHRatio As Single
    With Selection
    PicWtoHRatio = .Width / .Height
    End With
    With Selection.TopLeftCell
    CellWtoHRatio = .Width / .RowHeight
    End With
    Select Case PicWtoHRatio / CellWtoHRatio
    Case Is > 1
    With Selection
    .Width = .TopLeftCell.Width
    .Height = .Width / PicWtoHRatio
    End With
    Case Else
    With Selection
    .Height = .TopLeftCell.RowHeight
    .Width = .Height * PicWtoHRatio
    End With
    End Select
    With Selection
    .Top = .TopLeftCell.Top
    .Left = .TopLeftCell.Left
    End With
    Exit Sub
    NOT_SHAPE:
    MsgBox "Select a picture before running this macro."
    End Sub
    i want can select picture from another sheet before running this macro eg. like way easy copy paste picture between sheet
    my target in sheet bm1, bm2, etc..in any cell.....and then my photos from sheet p1,p2,p3, p...etc....(the name sheet is random)
    this my link file https://app.box.com/s/jz9zbfzsjh1ral71icfyf8xw5x4fprf8

    any help, greatly appreciated..

    .sst
    Last edited by susanto; 07-08-2020 at 07:47 PM.

Similar Threads

  1. Replies: 3
    Last Post: 07-09-2020, 02:17 AM
  2. Replies: 5
    Last Post: 06-12-2016, 06:51 AM
  3. Macro to Auto Run When Excel Cell Data Changes
    By vwallace in forum Excel Help
    Replies: 5
    Last Post: 11-05-2014, 11:04 PM
  4. Replies: 1
    Last Post: 10-25-2013, 10:37 PM
  5. Replies: 3
    Last Post: 06-01-2013, 11:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •