Shape Size based on Values

M

MichaelSpy2008

Is it possible to automatically resize a shape (eg arrow) based on a value.
If I change a value the shape will automatically change to reflect this.
 
J

Joel

You cna use a worksheet change function like the one below

Sub worksheet_change(ByVal target As Range)

If target.Address = "$F$2" Then

Shapes("Line 1").Height = target
End If

End Sub
 
L

Lars-Åke Aspelin

Is it possible to automatically resize a shape (eg arrow) based on a value.
If I change a value the shape will automatically change to reflect this.

Try this:
(change "A1" to the cell where your value is and "Right Arrow 1" to
the name of your shape)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Shapes("Right Arrow 1").Width = Target.Value
End If
End Sub

Hope this helps / Lars-Åke
 
M

MichaelSpy2008

Thanks for that guys but I can't get it to work, any chance of making it
clearer for a dummy?!
 
D

dan dungan

Does this functionality exist in Excel 2000? I don't see properties
for the line--I used the drawing toolbar, and I don't know how to
determine the line's name.

Thanks,

Dan
 
M

MichaelSpy2008

I have tried this and I get a argument not optional error message, Can you
help please. Thanks
 
L

Lars-Åke Aspelin

I have tried this and I get a argument not optional error message, Can you
help please. Thanks


For which function do you get that error message?
Maybe you should use ; (semicolon) rather than , (comma)
as separator of arguments.

Otherwise I can not think of why it does not work.
Maybe someone else can suggest what might be wrong.

/ Lars-Åke
 
M

MichaelSpy2008

Lars-Ã…ke Aspelin said:
For which function do you get that error message?
Maybe you should use ; (semicolon) rather than , (comma)
as separator of arguments.

Otherwise I can not think of why it does not work.
Maybe someone else can suggest what might be wrong.

/ Lars-Ã…ke

It seems to not recognise the "shapes" bit of the code
 
L

Lars-Åke Aspelin

What do you mean by "not recognize"?
Is the error message still "argument not optional"?
Maybe you could copy you subroutine here.

/ Lars-Åke
 

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