Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default vba newbie need help.

hi according to the below link method, how can i use the picture again for
another cell range?
can some kind soul tell me how to write the programming. thanks

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


Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
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.misc
external usenet poster
 
Posts: 35,218
Default vba newbie need help.

Maybe...

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim myCell As Range
Dim myRng As Range

Me.Pictures.Visible = False

'what cells contain the names of the pictures that should be visible?
Set myRng = Me.Range("F1,h9")

For Each myCell In myRng.Cells
With myCell
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
Next myCell
End Sub



Oligo wrote:

hi according to the below link method, how can i use the picture again for
another cell range?
can some kind soul tell me how to write the programming. thanks

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

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default vba newbie need help.

thanks dave. it works and solve my problem. thanks so much even though im not
sure about the program hehe.

"Dave Peterson" wrote:

Maybe...

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim myCell As Range
Dim myRng As Range

Me.Pictures.Visible = False

'what cells contain the names of the pictures that should be visible?
Set myRng = Me.Range("F1,h9")

For Each myCell In myRng.Cells
With myCell
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
Next myCell
End Sub



Oligo wrote:

hi according to the below link method, how can i use the picture again for
another cell range?
can some kind soul tell me how to write the programming. thanks

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

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
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
NEWBIE Tom Snyder Excel Discussion (Misc queries) 1 June 8th 07 06:47 PM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
newbie needs help p-nut Charts and Charting in Excel 2 November 15th 06 02:13 PM
Help for a newbie... please Nancie Excel Worksheet Functions 2 April 21st 06 01:48 AM
Help for a newbie? rehr0001 Excel Worksheet Functions 4 August 18th 05 05:13 AM


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