ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   AUTOSHAPE (https://www.excelbanter.com/excel-programming/329119-autoshape.html)

glenn

AUTOSHAPE
 
I have learned from you guys to have a pic become visible depending on a
cells results.

No I need help with an autoshape. I would like to do the same thing as the
pic. exp... If a cell results is x as a result of an if statement I would
like the auto shape to appear on the worksheet at a given cell.

I am a novice so please bear with me.
Thanks a million,
Glenn

Tom Ogilvy

AUTOSHAPE
 
I am sure the method would be practically identical, but can't tell you how
to modify something I can't see.

--
Regards,
Tom Ogilvy

"Glenn" wrote in message
...
I have learned from you guys to have a pic become visible depending on a
cells results.

No I need help with an autoshape. I would like to do the same thing as

the
pic. exp... If a cell results is x as a result of an if statement I would
like the auto shape to appear on the worksheet at a given cell.

I am a novice so please bear with me.
Thanks a million,
Glenn




glenn

AUTOSHAPE
 
This is the macro I use to place pics on the worksheet. Please advise me on
what to change to used autoshapes in the same manner.

"Tom Ogilvy" wrote:

I am sure the method would be practically identical, but can't tell you how
to modify something I can't see.

--
Regards,
Tom Ogilvy

"Glenn" wrote in message
...
I have learned from you guys to have a pic become visible depending on a
cells results.

No I need help with an autoshape. I would like to do the same thing as

the
pic. exp... If a cell results is x as a result of an if statement I would
like the auto shape to appear on the worksheet at a given cell.

I am a novice so please bear with me.
Thanks a million,
Glenn





glenn

AUTOSHAPE
 
Forgot to show the prgram...thanks

This is the program I used to place the pics on the worksheet. Please
advise me how to used it for autoshapes.
Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim myCell As Range
Dim myRng As Range

Set myRng = Me.Range("K5,L27,O29,Q13,p20,N5,o27")

Me.Pictures.Visible = False
For Each myCell In myRng.Cells
With myCell
For Each oPic In Me.Pictures
If LCase(oPic.Name) = LCase(.Text) Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
End If
Next oPic
End With
Next myCell

End Sub


"Tom Ogilvy" wrote:

I am sure the method would be practically identical, but can't tell you how
to modify something I can't see.

--
Regards,
Tom Ogilvy

"Glenn" wrote in message
...
I have learned from you guys to have a pic become visible depending on a
cells results.

No I need help with an autoshape. I would like to do the same thing as

the
pic. exp... If a cell results is x as a result of an if statement I would
like the auto shape to appear on the worksheet at a given cell.

I am a novice so please bear with me.
Thanks a million,
Glenn





Tom Ogilvy

AUTOSHAPE
 
Option Explicit
Private Sub Worksheet_Calculate()
Dim oShp As Shape
Dim myCell As Range
Dim myRng As Range

Set myRng = Me.Range("K5,L27,O29,Q13,p20,N5,o27")
for each oShp in Me.Shapes
if oShp.Type = msoAutoShape then
oShp.Visible = False
end if
Next
For Each myCell In myRng.Cells
With myCell
For Each oShp In Me.Shapes
if oShp.Type = msoAutoShape then
If LCase(oShp.Name) = LCase(.Text) Then
oShp.Visible = True
oShp.Top = .Top
oShp.Left = .Left
End If
End if
Next oShp
End With
Next myCell

End Sub

--
Regards,
Tom Ogilvy


"Glenn" wrote in message
...
Forgot to show the prgram...thanks

This is the program I used to place the pics on the worksheet. Please
advise me how to used it for autoshapes.
Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim myCell As Range
Dim myRng As Range

Set myRng = Me.Range("K5,L27,O29,Q13,p20,N5,o27")

Me.Pictures.Visible = False
For Each myCell In myRng.Cells
With myCell
For Each oPic In Me.Pictures
If LCase(oPic.Name) = LCase(.Text) Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
End If
Next oPic
End With
Next myCell

End Sub


"Tom Ogilvy" wrote:

I am sure the method would be practically identical, but can't tell you

how
to modify something I can't see.

--
Regards,
Tom Ogilvy

"Glenn" wrote in message
...
I have learned from you guys to have a pic become visible depending on

a
cells results.

No I need help with an autoshape. I would like to do the same thing

as
the
pic. exp... If a cell results is x as a result of an if statement I

would
like the auto shape to appear on the worksheet at a given cell.

I am a novice so please bear with me.
Thanks a million,
Glenn








All times are GMT +1. The time now is 12:13 PM.

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