Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Resizing a Picture

Hello,

Could some one please help me with the following?

I need a macro that when a user selects a picture on my spreadsheet
(named "items") then the macro will automatically format the selected
picture with the following format picture criteria:

Height = 10.11cm
Width = 14.92cm
Height = 253%
Width = 249%
lock aspect ratio = true
relative to original picture size = true
Original size = 4cm Height x 6cm Width

Any help would be greatly appreciated.

Thanks,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Resizing a Picture

start the macro recorder
select a picture & resize it the way you want it.
end the macro recorder
see what you've got!
(hint - remove the "selection" part, so it will work with whatever
picture is selected).
:)
susan


On Mar 28, 7:24 am, Longbow wrote:
Hello,

Could some one please help me with the following?

I need a macro that when a user selects a picture on my spreadsheet
(named "items") then the macro will automatically format the selected
picture with the following format picture criteria:

Height = 10.11cm
Width = 14.92cm
Height = 253%
Width = 249%
lock aspect ratio = true
relative to original picture size = true
Original size = 4cm Height x 6cm Width

Any help would be greatly appreciated.

Thanks,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdexhttp://www.developersdex.com***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Resizing a Picture

Hi Susan,

Thanks for your reply. I ran the following macro and received a
run-time error stating that the item with the specified name could not
be found.

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 28/03/2007 by User
'

'
ActiveSheet.Shapes("Picture 21").Select
Selection.ShapeRange.ScaleWidth 2.48, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.48, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.02, msoFalse, msoScaleFromTopLeft
End Sub

The first line of my macro code will not run according to the VBE that
highlights it in yellow after I debug the run-time error.

Could you please advise on how I can get around this problem.

Many thanks,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Resizing a Picture

good! yes, as to the problem you're having, remove this statement:

ActiveSheet.Shapes("Picture 21").Select

every time you add a shape or a picture, excel gives it a different
#. it's hard to keep track of them, because if you delete, say,
picture15, the next one inserted will not be another picture15, but
will be picture22 (or whatever # comes after the last one you
inserted).

if you take that line out, you can select a picture, any picture, and
run the macro, & it will reshape that one picture.
so if you add this macro to a toolbar button, you can select the
picture, and push the button, & it will reshape it.

hope this helps!
susan



On Mar 28, 8:34 am, Longbow wrote:
Hi Susan,

Thanks for your reply. I ran the following macro and received a
run-time error stating that the item with the specified name could not
be found.

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 28/03/2007 by User
'

'
ActiveSheet.Shapes("Picture 21").Select
Selection.ShapeRange.ScaleWidth 2.48, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.48, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.02, msoFalse, msoScaleFromTopLeft
End Sub

The first line of my macro code will not run according to the VBE that
highlights it in yellow after I debug the run-time error.

Could you please advise on how I can get around this problem.

Many thanks,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdexhttp://www.developersdex.com***



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Resizing a Picture

Thanks again Susan - your help was terrific and much appreciated.

Cheers,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdex http://www.developersdex.com ***
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
resizing a picture to fit a single cell HELP erical Excel Discussion (Misc queries) 2 January 4th 07 08:51 AM
How do i insert a picture in merged cels, with autom. resizing ? Sven Ghyselinck Excel Programming 5 March 27th 06 09:25 PM
How to stop Excel2002 auto resizing picture in header from templat lee Setting up and Configuration of Excel 0 December 15th 05 04:41 AM
Resizing Picture SamDev Excel Programming 0 October 14th 05 03:53 PM
Picture resizing Gixxer_J_97[_2_] Excel Programming 2 February 9th 05 02:35 PM


All times are GMT +1. The time now is 03:44 PM.

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"