ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find and display a picture (https://www.excelbanter.com/excel-programming/384265-find-display-picture.html)

Paul Pedersen

find and display a picture
 
I have a workbook with several sheets, each of which has several pictures.
Using VBA, I can activate the sheet that contains a given picture. But how
can I scroll the sheet to display that picture?





joel

find and display a picture
 
Try this. It wil find all shapes. You may need to check name of shapes to
see if they ae pictures verses other shapes.

Sub abc()
For Each MyPicture In Worksheets("Sheet3").Shapes

Row = MyPicture.TopLeftCell.Row
Column = MyPicture.TopLeftCell.Column


Worksheets("Sheet3").Cells(Row, Column).Select

Next MyPicture

End Sub
..




"Paul Pedersen" wrote:

I have a workbook with several sheets, each of which has several pictures.
Using VBA, I can activate the sheet that contains a given picture. But how
can I scroll the sheet to display that picture?






Paul Pedersen

find and display a picture
 
That works nicely, thank you.


"Joel" wrote in message
...
Try this. It wil find all shapes. You may need to check name of shapes
to
see if they ae pictures verses other shapes.

Sub abc()
For Each MyPicture In Worksheets("Sheet3").Shapes

Row = MyPicture.TopLeftCell.Row
Column = MyPicture.TopLeftCell.Column


Worksheets("Sheet3").Cells(Row, Column).Select

Next MyPicture

End Sub
.




"Paul Pedersen" wrote:

I have a workbook with several sheets, each of which has several
pictures.
Using VBA, I can activate the sheet that contains a given picture. But
how
can I scroll the sheet to display that picture?









All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com