#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Inserting Pictures

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Inserting Pictures

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Inserting Pictures

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Pictures Matthew[_2_] Excel Discussion (Misc queries) 3 July 14th 07 10:23 AM
Inserting pictures into worksheets Jose C Excel Discussion (Misc queries) 0 December 7th 06 04:06 AM
Inserting pictures then sorting Dav Excel Discussion (Misc queries) 2 November 3rd 05 11:39 AM
Inserting Pictures with IF function DrewNov Excel Worksheet Functions 0 August 25th 05 07:58 PM
inserting pictures in a workbook TCB Excel Discussion (Misc queries) 1 May 31st 05 12:54 PM


All times are GMT +1. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"