Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Urgent - Pl help code for assigning a shape to cells

Hi Mates

Could some one please tell me how I could assign a shape
(or even a jpeg image) to a particular cell using a code.
And also how to make it appear at the center of the cell.

Thanks in advance

sarah

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Urgent - Pl help code for assigning a shape to cells

Hi Sarah

This will add a jpg file on top of C1

Sub test()
Dim Pict As Picture
With ActiveSheet.Range("c1")
Set Pict = .Parent.Pictures.Insert("C:\ron.jpg")
Pict.Top = .Top
Pict.Width = .Width
Pict.Height = .Height
Pict.Left = .Left
Pict.Placement = xlMoveAndSize
End With
End Sub


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


"Sarah" wrote in message ...
Hi Mates

Could some one please tell me how I could assign a shape
(or even a jpeg image) to a particular cell using a code.
And also how to make it appear at the center of the cell.

Thanks in advance

sarah



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Urgent - Pl help code for assigning a shape to cells

Hi Sarah,

The following code inserts a picture and gives it the same size and position
as the C3 cell.


Set x = ActiveSheet.Pictures.Insert( "C:\Sample.jpg")

With Range("C3")
x.Top = .Top
x.Left = .Left
x.Width = .Width
x.Height = .Height
End With



"Sarah" wrote in message
...
Hi Mates

Could some one please tell me how I could assign a shape
(or even a jpeg image) to a particular cell using a code.
And also how to make it appear at the center of the cell.

Thanks in advance

sarah



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
Assigning a shape to cell Sarah W Excel Programming 1 September 27th 04 12:33 AM
Assigning VBA code to a Toolbar Bonnie[_5_] Excel Programming 2 November 11th 03 06:23 PM
Assign code to shape Jacob Excel Programming 1 November 4th 03 02:53 PM
Assigning Macro To Shape Tommi[_2_] Excel Programming 2 October 31st 03 10:58 AM
Assigning Selected Cells to Code JMay Excel Programming 4 July 19th 03 05:29 PM


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