Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assigning a shape to cell | Excel Programming | |||
Assigning VBA code to a Toolbar | Excel Programming | |||
Assign code to shape | Excel Programming | |||
Assigning Macro To Shape | Excel Programming | |||
Assigning Selected Cells to Code | Excel Programming |