Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problem - Deleting a Picture from a Cell

You are starting with an incorrect perception. Pictures are on a different
layer than cells. They may sit over a cell, but they are not in the cell.
You would need to loop and find the picture

Sub DeletePicture()
Dim pic As OLEObject
For Each pic In ActiveSheet.Pictures
If pic.TopLeftCell.Address = _
Cells(10, 1).Address Then
pic.Delete
End If
Next
End Sub

--
Regards,
Tom Ogilvy



general zod wrote in message
...

I have inserted a small picture (jpg) into cell (a1)


and I have used the following excel 97 VBA code to copy that picture
into cell a10


Cells(1, 1).Select

Cells(1, 1).CopyPicture

Cells(10, 1).PasteSpecial


Does anyone know the VBA code to then delete the picture from cell
(10,1) A10 ????

Cells(10,1).delete just deletes the cell , it leaves the picture
there ?


.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem - Deleting a Picture from a Cell

I stand corrected !! , thankyou very much - appreciated


On Sun, 20 Jul 2003 13:37:55 -0400, "Tom Ogilvy"
wrote:

You are starting with an incorrect perception. Pictures are on a different
layer than cells. They may sit over a cell, but they are not in the cell.
You would need to loop and find the picture

Sub DeletePicture()
Dim pic As OLEObject
For Each pic In ActiveSheet.Pictures
If pic.TopLeftCell.Address = _
Cells(10, 1).Address Then
pic.Delete
End If
Next
End Sub


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
Picture problem dwake Excel Discussion (Misc queries) 1 May 12th 10 07:40 PM
Inserting a Picture using Cell as picture name. the-jackal Links and Linking in Excel 12 November 10th 08 09:21 AM
how do I insert picture into cell so vlookup can return picture? ah Excel Worksheet Functions 1 May 1st 07 04:38 AM
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
how prevent formula in cell from deleting when deleting value???? sh-boom New Users to Excel 1 September 30th 05 06:12 PM


All times are GMT +1. The time now is 12:17 PM.

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"