Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dave
 
Posts: n/a
Default automatically fit an image into merged cells

can anyone tell me how to insert an image into excel so it appears in the
same place every time also so it resizes to the merged cells i have created
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

one way:

Insert the image then run this macro. Adjust the cell reference as
desired:

Public Sub PositionAndScalePic()
Dim rArea As Range
Dim dFactor As Double
Set rArea = ActiveSheet.Range("J5").MergeArea
With ActiveSheet.Pictures
With .Item(.Count)
.Top = rArea.Top
.Left = rArea.Left
dFactor = rArea.Width / .Width
.Width = rArea.Width
.Height = .Height * dFactor
If .Height rArea.Height Then
dFactor = rArea.Height / .Height
.Height = rArea.Height
.Width = .Width * dFactor
End If
.Placement = xlMoveAndSize
End With
End With
End Sub



In article ,
"dave" wrote:

can anyone tell me how to insert an image into excel so it appears in the
same place every time also so it resizes to the merged cells i have created

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
Excel merged cell - can it automatically expand as text is typed? Joanne (JAS) New Users to Excel 2 January 8th 05 12:11 AM
Auto fit merged cells Anson Excel Discussion (Misc queries) 1 December 20th 04 09:09 PM
paste info into merged cells Marc Setting up and Configuration of Excel 0 December 6th 04 09:09 PM
Protected cells -automatically format to a different color Fred Evans Excel Discussion (Misc queries) 9 December 3rd 04 12:59 PM
Sorting merged cellsHow do I sort merged cells not identically siz Laval Excel Worksheet Functions 1 November 3rd 04 09:40 PM


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