Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ChrisP
 
Posts: n/a
Default Importing pictures and re scaling

Im going to import lots of pictures into my spreadsheet and they are all the
same original size. I have to import them 1 by 1 and rescale them to 20% of
the original size. It would also be sweet if it was possible to rescale them
to the the size of the cell its being imported into.

I have searched all over to find a way to do this, anyone know how to do it?

(I dont want to use another prog to rescale the pictures)

thanks!

Chris
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default Importing pictures and re scaling

This may give you an idea:

Option Explicit
Sub testme02()

Dim myPicNames As Variant
Dim myPict As Picture
Dim myAddresses As Variant
Dim myRng As Range
Dim iCtr As Long

myPicNames = Array("c:\pict1.jpg", _
"C:\pict2.jpg")

myAddresses = Array("a1:c3", "e1:g3")

If UBound(myPicNames) < UBound(myAddresses) Then
MsgBox "design error"
Exit Sub
End If

With Worksheets("sheet1")
For iCtr = LBound(myPicNames) To UBound(myPicNames)
Set myRng = .Range(myAddresses(iCtr))
Set myPict = .Pictures.Insert(myPicNames(iCtr))
myPict.Top = myRng.Top
myPict.Width = myRng.Width
myPict.Height = myRng.Height
myPict.Left = myRng.Left
myPict.Placement = xlMoveAndSize
Next iCtr
End With
End Sub



ChrisP wrote:

Im going to import lots of pictures into my spreadsheet and they are all the
same original size. I have to import them 1 by 1 and rescale them to 20% of
the original size. It would also be sweet if it was possible to rescale them
to the the size of the cell its being imported into.

I have searched all over to find a way to do this, anyone know how to do it?

(I dont want to use another prog to rescale the pictures)

thanks!

Chris


--

Dave Peterson
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
how do I embed/Link pictures onto excel database cells? a0relento Excel Discussion (Misc queries) 0 October 14th 05 05:27 AM
McGimpsey's Disappearing Pictures PW11111 Excel Discussion (Misc queries) 1 October 10th 05 03:52 PM
Is it possible to use some pictures in an IF function? [email protected] Excel Worksheet Functions 1 October 4th 05 05:10 AM
Pictures in a cell. ISUTUBBS Excel Discussion (Misc queries) 2 August 18th 05 01:01 PM
Viewing Pictures Nicola Excel Discussion (Misc queries) 1 December 8th 04 03:24 PM


All times are GMT +1. The time now is 01:41 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"