ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with pictures in excel (https://www.excelbanter.com/excel-programming/371924-help-pictures-excel.html)

[email protected]

Help with pictures in excel
 
Hello,
I have been reading posts here for several weeks and I am amazed at the
vast wealth of knowledge out there about Excel (some of you have such
great websites...!!!). I have used Excel for years and only recently
decided to try to learn VBA. I was wondering if someone out there
could possibly help me with a problem? I have a project where I would
like to have several pictures that will be available in all the
workbooks created from my template that can be opened either in a
userform or on a worksheet and can be "annotated". Essentially, I want
the user to be able to draw on the picture and "save it" to the
worksheet.

I need to keep the pictures somewhere (I thought to have them on the
worksheet in layers and hidden but I would prefer not to keep all the
pictures on each workbook that is created from the template, I would
rather just call/create the one or two that each "user" will need in
that workbook) then programmatically make them visible when called and
open the drawing toolbar.

The problem I have is two-fold:
how to position the pictures so that they will appear in the same
place no matter who opens the program (I would prefer to have them open
relative to a certain cell on the sheet) and
how to make them hidden and then visible.

I know how to do this on a userform but I don't know how to do it on
the worksheet. I have combed the 'net to see how to draw on the
picture on a userform but the only reference I could find showed a
macro that, while it does it well on the userform itself, was unable to
draw on an image on the userform and it was also quite limited on what
type of drawing could be done.

Does anyone know how to accomplish any/all of what I am asking? I
would very much appreciate the help.
Thanks,
Michelle


LooneyTunes

Help with pictures in excel
 
Here are 2 routines to toggle the shapes on and off. I got some
routines for positioning them but do not have time to find them right
now. The basic logic is to paste them at "a1" and then increment
them down based on looping through the other shapes n the sheet and
moving down past them.

Look up .TopLeftCell (for placement relative to a cell) and .Height
(as in ActiveSheet.Shapes("test").Height) in Help will probably get you
there. Otherwise re-post and I will dig the stuff up.

Shapes are a little funny so here's how you toggle them:

Sub TurnOnShapes()
Dim shp As Shape

With ActiveSheet
For Each shp In .Shapes
.Shapes(shp.Name).Visible = True
Next shp
End With

End Sub

Sub TurnOffShapes()
Dim shp As Shape

ActiveSheet.Shapes.SelectAll
Selection.Visible = False

End Sub


Good luck and happy programming

LooneyTunes

wrote:
Hello,
I have been reading posts here for several weeks and I am amazed at the
vast wealth of knowledge out there about Excel (some of you have such
great websites...!!!). I have used Excel for years and only recently
decided to try to learn VBA. I was wondering if someone out there
could possibly help me with a problem? I have a project where I would
like to have several pictures that will be available in all the
workbooks created from my template that can be opened either in a
userform or on a worksheet and can be "annotated". Essentially, I want
the user to be able to draw on the picture and "save it" to the
worksheet.

I need to keep the pictures somewhere (I thought to have them on the
worksheet in layers and hidden but I would prefer not to keep all the
pictures on each workbook that is created from the template, I would
rather just call/create the one or two that each "user" will need in
that workbook) then programmatically make them visible when called and
open the drawing toolbar.

The problem I have is two-fold:
how to position the pictures so that they will appear in the same
place no matter who opens the program (I would prefer to have them open
relative to a certain cell on the sheet) and
how to make them hidden and then visible.

I know how to do this on a userform but I don't know how to do it on
the worksheet. I have combed the 'net to see how to draw on the
picture on a userform but the only reference I could find showed a
macro that, while it does it well on the userform itself, was unable to
draw on an image on the userform and it was also quite limited on what
type of drawing could be done.

Does anyone know how to accomplish any/all of what I am asking? I
would very much appreciate the help.
Thanks,
Michelle



doc[_2_]

Help with pictures in excel
 
Thank you very much, this is just the help I needed. Have a good
night!
Michelle

LooneyTunes wrote:
Here are 2 routines to toggle the shapes on and off. I got some
routines for positioning them but do not have time to find them right
now. The basic logic is to paste them at "a1" and then increment
them down based on looping through the other shapes n the sheet and
moving down past them.

Look up .TopLeftCell (for placement relative to a cell) and .Height
(as in ActiveSheet.Shapes("test").Height) in Help will probably get you
there. Otherwise re-post and I will dig the stuff up.

Shapes are a little funny so here's how you toggle them:

Sub TurnOnShapes()
Dim shp As Shape

With ActiveSheet
For Each shp In .Shapes
.Shapes(shp.Name).Visible = True
Next shp
End With

End Sub

Sub TurnOffShapes()
Dim shp As Shape

ActiveSheet.Shapes.SelectAll
Selection.Visible = False

End Sub


Good luck and happy programming

LooneyTunes

wrote:
Hello,
I have been reading posts here for several weeks and I am amazed at the
vast wealth of knowledge out there about Excel (some of you have such
great websites...!!!). I have used Excel for years and only recently
decided to try to learn VBA. I was wondering if someone out there
could possibly help me with a problem? I have a project where I would
like to have several pictures that will be available in all the
workbooks created from my template that can be opened either in a
userform or on a worksheet and can be "annotated". Essentially, I want
the user to be able to draw on the picture and "save it" to the
worksheet.

I need to keep the pictures somewhere (I thought to have them on the
worksheet in layers and hidden but I would prefer not to keep all the
pictures on each workbook that is created from the template, I would
rather just call/create the one or two that each "user" will need in
that workbook) then programmatically make them visible when called and
open the drawing toolbar.

The problem I have is two-fold:
how to position the pictures so that they will appear in the same
place no matter who opens the program (I would prefer to have them open
relative to a certain cell on the sheet) and
how to make them hidden and then visible.

I know how to do this on a userform but I don't know how to do it on
the worksheet. I have combed the 'net to see how to draw on the
picture on a userform but the only reference I could find showed a
macro that, while it does it well on the userform itself, was unable to
draw on an image on the userform and it was also quite limited on what
type of drawing could be done.

Does anyone know how to accomplish any/all of what I am asking? I
would very much appreciate the help.
Thanks,
Michelle




All times are GMT +1. The time now is 09:34 PM.

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