From: John on
Hi Everyone
I've taken John McGimpsey's code and modified then for my needs.
What I'm trying to do is, have the picture follow along with the active cell.
I 've got a list of names from B3:B62 and D3:D62 that matches a picture.
Now the picture are staying at the top, and would like them to scroll down with
the selection.
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim oPic As Picture
Me.Pictures.Visible = False
For Each oPic In Me.Pictures
If oPic.Name = ActiveCell.Text Then
oPic.Visible = True
" This line not working >>>" oPic.Top = ActiveCell.Offset(3, 3)
oPic.Left = 600
Exit For
End If
Next oPic
End Sub

Hope someone can help me
Regards
John

From: JLGWhiz on
I have not worked with picture objects, but have you tried using the TopLeft
property? It might do what you want. Check it out in VBA help.


"John" <johnd(a)newlook.com> wrote in message
news:OaqH8V3zKHA.4328(a)TK2MSFTNGP04.phx.gbl...
> Hi Everyone
> I've taken John McGimpsey's code and modified then for my needs.
> What I'm trying to do is, have the picture follow along with the active
> cell.
> I 've got a list of names from B3:B62 and D3:D62 that matches a picture.
> Now the picture are staying at the top, and would like them to scroll down
> with the selection.
> Option Explicit
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> Dim oPic As Picture
> Me.Pictures.Visible = False
> For Each oPic In Me.Pictures
> If oPic.Name = ActiveCell.Text Then
> oPic.Visible = True
> " This line not working >>>" oPic.Top = ActiveCell.Offset(3, 3)
> oPic.Left = 600
> Exit For
> End If
> Next oPic
> End Sub
>
> Hope someone can help me
> Regards
> John


From: John on
Hi JLGWhiz
Thanks for your help, i tried it out but can't get it to work. I don't know
anough about VBA.
Regards
John
"JLGWhiz" <JLGWhiz(a)cfl.rr.com> wrote in message
news:uj$Gyb4zKHA.4656(a)TK2MSFTNGP05.phx.gbl...
>I have not worked with picture objects, but have you tried using the TopLeft
>property? It might do what you want. Check it out in VBA help.
>
>
> "John" <johnd(a)newlook.com> wrote in message
> news:OaqH8V3zKHA.4328(a)TK2MSFTNGP04.phx.gbl...
>> Hi Everyone
>> I've taken John McGimpsey's code and modified then for my needs.
>> What I'm trying to do is, have the picture follow along with the active cell.
>> I 've got a list of names from B3:B62 and D3:D62 that matches a picture.
>> Now the picture are staying at the top, and would like them to scroll down
>> with the selection.
>> Option Explicit
>> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>> Dim oPic As Picture
>> Me.Pictures.Visible = False
>> For Each oPic In Me.Pictures
>> If oPic.Name = ActiveCell.Text Then
>> oPic.Visible = True
>> " This line not working >>>" oPic.Top = ActiveCell.Offset(3, 3)
>> oPic.Left = 600
>> Exit For
>> End If
>> Next oPic
>> End Sub
>>
>> Hope someone can help me
>> Regards
>> John
>
>

From: John on
Hi Everyone
Does anyone have any ideas, anything I could try.
Plus does anyone know how many Pictures can be used, It seem to stop at 62.
Regards
John
"John" <johnd(a)newlook.com> wrote in message
news:OaqH8V3zKHA.4328(a)TK2MSFTNGP04.phx.gbl...
> Hi Everyone
> I've taken John McGimpsey's code and modified then for my needs.
> What I'm trying to do is, have the picture follow along with the active cell.
> I 've got a list of names from B3:B62 and D3:D62 that matches a picture.
> Now the picture are staying at the top, and would like them to scroll down
> with the selection.
> Option Explicit
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> Dim oPic As Picture
> Me.Pictures.Visible = False
> For Each oPic In Me.Pictures
> If oPic.Name = ActiveCell.Text Then
> oPic.Visible = True
> " This line not working >>>" oPic.Top = ActiveCell.Offset(3, 3)
> oPic.Left = 600
> Exit For
> End If
> Next oPic
> End Sub
>
> Hope someone can help me
> Regards
> John