Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
is it possible to set an area in an excel sheet to receive a pasted picture ?
I want to set an area that will accept a picture from the clipbord but I want to have a defined size so that the same picture size comes out every time and I can have text etc on the page in the same place every time |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
There's no built-in way to do this. You could easily use a macro:
Public Sub SetPicture() Const cnMAXHEIGHT As Long = 250 Const cnMAXWIDTH As Long = 200 Dim rTopLeft As Range Dim dScale As Double If TypeOf Selection Is Picture Then With Selection Set rTopLeft = .Parent.Range("F2") .Top = rTopLeft.Top .Left = rTopLeft.Left dScale = Application.Min( _ cnMAXWIDTH / .Width, cnMAXHEIGHT / .Height) With .ShapeRange .ScaleWidth dScale, False, msoScaleFromTopLeft .ScaleHeight dScale, False, msoScaleFromTopLeft End With End With Else MsgBox "Please select a picture" End If End Sub In article , DamienO wrote: is it possible to set an area in an excel sheet to receive a pasted picture ? I want to set an area that will accept a picture from the clipbord but I want to have a defined size so that the same picture size comes out every time and I can have text etc on the page in the same place every time |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for that. I'll give it a go later
"JE McGimpsey" wrote: There's no built-in way to do this. You could easily use a macro: Public Sub SetPicture() Const cnMAXHEIGHT As Long = 250 Const cnMAXWIDTH As Long = 200 Dim rTopLeft As Range Dim dScale As Double If TypeOf Selection Is Picture Then With Selection Set rTopLeft = .Parent.Range("F2") .Top = rTopLeft.Top .Left = rTopLeft.Left dScale = Application.Min( _ cnMAXWIDTH / .Width, cnMAXHEIGHT / .Height) With .ShapeRange .ScaleWidth dScale, False, msoScaleFromTopLeft .ScaleHeight dScale, False, msoScaleFromTopLeft End With End With Else MsgBox "Please select a picture" End If End Sub In article , DamienO wrote: is it possible to set an area in an excel sheet to receive a pasted picture ? I want to set an area that will accept a picture from the clipbord but I want to have a defined size so that the same picture size comes out every time and I can have text etc on the page in the same place every time |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting Pictures | Excel Discussion (Misc queries) | |||
Inserting pictures into worksheets | Excel Discussion (Misc queries) | |||
Inserting pictures then sorting | Excel Discussion (Misc queries) | |||
Inserting Pictures with IF function | Excel Worksheet Functions | |||
inserting pictures in a workbook | Excel Discussion (Misc queries) |