Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Graphics Call With Macro - How to Exclude Some Pix?

I have a macro in a worksheet that works in conjunction with a VLOOKUP to
display pictures based on the VLOOKUP. The appropriate picture displays at
the P16 cell location. My problem is when I put the macro in, it makes ALL
my graphic objects (PICTURE) disappear except for the one the VLOOKUP calls
for. How can I exclude some of the other graphic objects that are on the
sheet? I tried renaming the objects and it still didn't work i.e.(Picture
100 to Pic 100 and also tried Obj 100). It know someway that it's a graphic.
Here's the code I used:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("P16")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Graphics Call With Macro - How to Exclude Some Pix?

You have a response in .excel

DocuMike wrote:

I have a macro in a worksheet that works in conjunction with a VLOOKUP to
display pictures based on the VLOOKUP. The appropriate picture displays at
the P16 cell location. My problem is when I put the macro in, it makes ALL
my graphic objects (PICTURE) disappear except for the one the VLOOKUP calls
for. How can I exclude some of the other graphic objects that are on the
sheet? I tried renaming the objects and it still didn't work i.e.(Picture
100 to Pic 100 and also tried Obj 100). It know someway that it's a graphic.
Here's the code I used:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("P16")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub


--

Dave Peterson
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
How can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
Print macro to exclude a cell JaimeLex Excel Discussion (Misc queries) 5 April 18th 08 09:06 PM
Sort Macro to Exclude Blank Rows? ScottPcola Excel Worksheet Functions 1 January 5th 06 07:10 PM
Macro to exclude blank line and total column Janmy Excel Programming 2 March 3rd 04 12:02 PM


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