PC Review


Reply
Thread Tools Rate Thread

Delete multiple pictures on top of a range?

 
 
fedude
Guest
Posts: n/a
 
      1st Mar 2008
With the enormous help of this forum I created a routine to copy a single
picture multiple times on top of a 10x14 range of cells (it's a golf
scorecard). The picture is a large circle to identify which hole gets
strokes for handicaps. I notice that every time I copy a picture it gets
the next "picture xxxx" sequence name. Not sure if this is pertinent or not.

After I print the scorecard, I need to delete the pictures and start again.
Does anyone know a way to delete pictures that happen to be laying on top of
a range? With a mouse I manually can select the picture and hit "delete",
but how can I do this in a VB subroutine that I can call from my macro?
 
Reply With Quote
 
 
 
 
fedude
Guest
Posts: n/a
 
      1st Mar 2008
Nevermind... I found the answer in a previous post. Should have looked
more thoroughly

==================

Sub ClearScorecard()

Dim s As String
Dim pic As Picture
Dim rng As Range

' Set ws = ActiveSheet
Set ws = ActiveWorkbook.Worksheets("Sheet1")
Set rng = ws.Range("A20:J39")

For Each pic In ActiveSheet.Pictures
With pic
s = .TopLeftCell.Address & ":" & .BottomRightCell.Address
End With
If Not Intersect(rng, ws.Range(s)) Is Nothing Then
pic.Delete
End If
Next
End Sub

=================================

"fedude" wrote:

> With the enormous help of this forum I created a routine to copy a single
> picture multiple times on top of a 10x14 range of cells (it's a golf
> scorecard). The picture is a large circle to identify which hole gets
> strokes for handicaps. I notice that every time I copy a picture it gets
> the next "picture xxxx" sequence name. Not sure if this is pertinent or not.
>
> After I print the scorecard, I need to delete the pictures and start again.
> Does anyone know a way to delete pictures that happen to be laying on top of
> a range? With a mouse I manually can select the picture and hit "delete",
> but how can I do this in a VB subroutine that I can call from my macro?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete multiple range names mnsue Microsoft Excel Misc 8 18th Jan 2010 10:41 PM
How do I delete multiple pictures at one time? swmcphrsn Microsoft Excel Misc 3 22nd Jan 2009 03:03 PM
select and delete all pictures in a given range the excel-arator Microsoft Excel Programming 5 3rd Feb 2008 10:42 PM
How can I select/delete multiple pictures Jim T Microsoft Excel Discussion 3 15th Nov 2007 01:32 AM
Delete Multiple Pictures =?Utf-8?B?U3VwZQ==?= Microsoft Excel Misc 3 9th Apr 2007 07:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:07 AM.