Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 148
Default Image Manipulation in Excel

Hi All

I am trying to manipulate some images in an Excel spreasheet using the
following code:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("D3")
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

From the following web page:

http://www.mcgimpsey.com/excel/lookuppics.html

My problem is this code has all images set to visible = False.... I need 1
image visible all the time.

Any ideas on how I can make 1 picture visible all the time

I have 7 Pictures (Picture 1 to 7) that are run by the above code, picture 8
needs to be visible all the time.

Any help appreciated

Regards

Danny
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Image Manipulation in Excel

Too Simple

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



"Danny" wrote:

Hi All

I am trying to manipulate some images in an Excel spreasheet using the
following code:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("D3")
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

From the following web page:

http://www.mcgimpsey.com/excel/lookuppics.html

My problem is this code has all images set to visible = False.... I need 1
image visible all the time.

Any ideas on how I can make 1 picture visible all the time

I have 7 Pictures (Picture 1 to 7) that are run by the above code, picture 8
needs to be visible all the time.

Any help appreciated

Regards

Danny

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Image Manipulation in Excel

the original code didn't keep Picture 8 visible. This is better

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("D3")
For Each oPic In Me.Pictures
Select Case oPic.Name
Case "Picture 8"
'Do Nothing
Case oPic.Name = .Text
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Case Else
oPic.Visible = False
End Select
Next oPic
End With
End Sub


"Danny" wrote:

Hi All

I am trying to manipulate some images in an Excel spreasheet using the
following code:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("D3")
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

From the following web page:

http://www.mcgimpsey.com/excel/lookuppics.html

My problem is this code has all images set to visible = False.... I need 1
image visible all the time.

Any ideas on how I can make 1 picture visible all the time

I have 7 Pictures (Picture 1 to 7) that are run by the above code, picture 8
needs to be visible all the time.

Any help appreciated

Regards

Danny

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Image Manipulation in Excel

How about just making sure it's visible:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
me.pictures("Picture 8").visible = true
With Range("D3")
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

I bet you don't even notice a flicker--but if you do, you could loop through all
the pictures and hide them if they aren't picture 8.

for each opic in me.pictures
if opic.name = "Picture 8" then
'do nothing
else
opic.visible = false
end if
next opic

This would replace the "Me.Pictures.Visible = False" line.

Danny wrote:

Hi All

I am trying to manipulate some images in an Excel spreasheet using the
following code:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("D3")
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

From the following web page:

http://www.mcgimpsey.com/excel/lookuppics.html

My problem is this code has all images set to visible = False.... I need 1
image visible all the time.

Any ideas on how I can make 1 picture visible all the time

I have 7 Pictures (Picture 1 to 7) that are run by the above code, picture 8
needs to be visible all the time.

Any help appreciated

Regards

Danny


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 148
Default Image Manipulation in Excel

Hi Joel

Thank you very much for your responses!! I can't get either to work at the
moment but you've certainly given me somthing to work with. If I can work it
out I'll post my solution back to you.

If you have any other ideas then please let me know

Thanks once again!!!!

Danny

"Joel" wrote:

the original code didn't keep Picture 8 visible. This is better

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("D3")
For Each oPic In Me.Pictures
Select Case oPic.Name
Case "Picture 8"
'Do Nothing
Case oPic.Name = .Text
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Case Else
oPic.Visible = False
End Select
Next oPic
End With
End Sub


"Danny" wrote:

Hi All

I am trying to manipulate some images in an Excel spreasheet using the
following code:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("D3")
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

From the following web page:

http://www.mcgimpsey.com/excel/lookuppics.html

My problem is this code has all images set to visible = False.... I need 1
image visible all the time.

Any ideas on how I can make 1 picture visible all the time

I have 7 Pictures (Picture 1 to 7) that are run by the above code, picture 8
needs to be visible all the time.

Any help appreciated

Regards

Danny

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
data manipulation in excel... vlookupabyss Excel Discussion (Misc queries) 0 January 8th 08 11:06 AM
Excel Manipulation Baffled Excel Discussion (Misc queries) 16 July 30th 07 12:34 PM
Excel Spreadsheet Manipulation Baffy Excel Discussion (Misc queries) 21 July 29th 07 01:34 PM
Hyperlink to an image in other worksheet, displaying entire image. twilliams Excel Worksheet Functions 0 February 7th 06 10:02 PM
Excel Time Manipulation BFiedler Excel Discussion (Misc queries) 0 September 15th 05 01:15 AM


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