Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom functions calculating time arguments Help Desperate | Excel Worksheet Functions | |||
insert picture to a specfic range of cells | Excel Discussion (Misc queries) | |||
How to copy single cell into cell that is merged from two cells? | Excel Discussion (Misc queries) | |||
xls worksheet formatting a single cell | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions |