Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default resizing a picture to fit a single cell HELP

I'm creating a spreadsheet featuring a large number of pictures. Each picture
must fit into 1 cell, which i have already resized to fit the desired size.
How can I resize the picture to fit into that 1 cell without the picture
looking disformed?
Thanks for any help you can offer.
Erica
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default resizing a picture to fit a single cell HELP

Make the cell really large?

Note: pictures do not go into the cell, only float on top.


Gord Dibben MS Excel MVP

On Wed, 3 Jan 2007 20:00:00 -0800, erical
wrote:

I'm creating a spreadsheet featuring a large number of pictures. Each picture
must fit into 1 cell, which i have already resized to fit the desired size.
How can I resize the picture to fit into that 1 cell without the picture
looking disformed?
Thanks for any help you can offer.
Erica


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default resizing a picture to fit a single cell HELP

Hi Erica,

Try this macro.
Select the picture then position it so that its top left corner is
inside the cell that you are wanting it to completely fit without
distortion, then run the macro.

Public Sub FitPic()
On Error GoTo NOT_SHAPE
Dim PicWtoHRatio As Single
Dim CellWtoHRatio As Single
With Selection
PicWtoHRatio = .Width / .Height
End With
With Selection.TopLeftCell
CellWtoHRatio = .Width / .RowHeight
End With
Select Case PicWtoHRatio / CellWtoHRatio
Case Is 1
With Selection
.Width = .TopLeftCell.Width
.Height = .Width / PicWtoHRatio
End With
Case Else
With Selection
.Height = .TopLeftCell.RowHeight
.Width = .Height * PicWtoHRatio
End With
End Select
With Selection
.Top = .TopLeftCell.Top
.Left = .TopLeftCell.Left
End With
Exit Sub
NOT_SHAPE:
MsgBox "Select a picture before running this macro."
End Sub

Ken Johnson

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
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
insert picture to a specfic range of cells CORY Excel Discussion (Misc queries) 8 February 3rd 06 05:50 PM
How to copy single cell into cell that is merged from two cells? Rod Excel Discussion (Misc queries) 3 January 22nd 06 09:24 PM
xls worksheet formatting a single cell Archer------------> Excel Discussion (Misc queries) 1 April 30th 05 07:25 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 04:25 PM.

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

About Us

"It's about Microsoft Excel"