Focus on a picture

S

Scientific

Hello all,

Last ? for today, I promise.

I have a picture in cell A1 and I want the focus to be on the picture, not
the cell it occupies when the workbook opens. Is this possible?

-S
 
S

Scientific

I figured out how to do this with the following code:

Sub Workbook_Open()
Set myDocument = Worksheets(1)
myDocument.Shapes("Picture 1").Select
End Sub

I had to first give a name to the picture from Insert Menu:

<Insert> <Name> <Define>

-S
 
D

Dave Peterson

You want the picture selected when the workbook is opened?

Option Explicit
Sub Auto_Open()
With Worksheets("Sheet1")
Application.Goto .Range("a1"), scroll:=True
.Pictures("picture 1").Select
End With
End Sub

Change the name of the sheet and the name of the picture.
 
S

Scientific

Dave,

Many thanks to you for your help on this. It works great and I'm very
grateful for your contribution. Keep up the good work my friend :)

-S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top