Picture fun

dumbitdown

New Member
Joined
Jul 23, 2007
Messages
28
I'm trying to copy several cells from one workbook and paste them in another as a picture

Once it's pasted in to the new workbook I want to be able to resize it - this is where I'm getting stuck

Any help anyone can provide would be much appreciated...
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Which version of Excel are you using? The new versions have a Copy as Picture feature available in the Home Tab
 
Upvote 0
What issues are you having. I've just psetd an image of a Table into a sheet & dragged it to a bigger size. Obviously there will be a limit to the size
 
Upvote 0
HAHA!! sorry I'm such an idiot, I'm using VBA to do it!!! Just shows what kind of day I'm having right now...
 
Upvote 0
Can you adapt this? You could save the range as an image first

Code:
Option Explicit


'With the macro below you can insert pictures and fit them to any range in a worksheet.


Sub TestInsertPictureInRange()
    Dim picToOpen As String
    picToOpen = Application _
                .GetOpenFilename("Pics (*.jpg), *.jpg")
    If picToOpen <> "" Then InsertPictureInRange picToOpen, _
       Range("B5:D10")
End Sub


Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range)
    ' inserts a picture and resizes it to fit the TargetCells range
    Dim p As Object, t As Double, l As Double, w As Double, h As Double
    If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
    If Dir(PictureFileName) = "" Then Exit Sub
    ' import picture
    Set p = ActiveSheet.Pictures.Insert(PictureFileName)
    ' determine positions
    With TargetCells
        t = .Top
        l = .Left
        w = .Offset(0, .Columns.Count).Left - .Left
        h = .Offset(.Rows.Count, 0).Top - .Top
    End With
    ' position picture
    With p
        .Top = t
        .Left = l
        .Width = w
        .Height = h
    End With
    Set p = Nothing
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top