A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

autosize a picture to a cell



 
 
Thread Tools Display Modes
  #1  
Old April 7th, 2004, 06:18 PM
david p
external usenet poster
 
Posts: n/a
Default autosize a picture to a cell


  #2  
Old April 7th, 2004, 06:34 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default autosize a picture to a cell

Hi

This will add a picture in the activecell
Post back with more textg if you need something else

Sub test()
On Error Resume Next
Set pic = ActiveSheet.Pictures.Insert("C:\range.gif")
On Error GoTo 0
If Not pic Is Nothing Then 'The picture exists
Set rng = ActiveCell
With pic
.Height = rng.Height
.Width = rng.Width
.Left = rng.Left
.Top = rng.Top
End With
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"david p" wrote in message ...



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.