Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Shape Size based on Values

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default Shape Size based on Values

On Wed, 26 Mar 2008 09:08:02 -0700, MichaelSpy2008
wrote:

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Shape Size based on Values

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

"Lars-Ã…ke Aspelin" wrote:

On Wed, 26 Mar 2008 09:08:02 -0700, MichaelSpy2008
wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Shape Size based on Values

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

"Lars-Ã…ke Aspelin" wrote:

On Wed, 26 Mar 2008 09:08:02 -0700, MichaelSpy2008
wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default Shape Size based on Values

On Thu, 27 Mar 2008 02:41:05 -0700, MichaelSpy2008
wrote:

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

"Lars-Åke Aspelin" wrote:

On Wed, 26 Mar 2008 09:08:02 -0700, MichaelSpy2008
wrote:

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



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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Shape Size based on Values



"Lars-Ã…ke Aspelin" wrote:

On Thu, 27 Mar 2008 02:41:05 -0700, MichaelSpy2008
wrote:

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

"Lars-Ã…ke Aspelin" wrote:

On Wed, 26 Mar 2008 09:08:02 -0700, MichaelSpy2008
wrote:

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



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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default Shape Size based on Values

On Thu, 27 Mar 2008 06:10:02 -0700, MichaelSpy2008
wrote:



"Lars-Åke Aspelin" wrote:

On Thu, 27 Mar 2008 02:41:05 -0700, MichaelSpy2008
wrote:

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

"Lars-Åke Aspelin" wrote:

On Wed, 26 Mar 2008 09:08:02 -0700, MichaelSpy2008
wrote:

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



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


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

/ Lars-Åke

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Shape Size based on Values

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


"MichaelSpy2008" wrote:

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.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 411
Default Shape Size based on Values

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building a process in Excel. How do I see the size of the shape, Jim Baker Setting up and Configuration of Excel 0 September 22nd 09 10:07 PM
draw shape based on cell values Defoes Right Boot Excel Programming 5 February 10th 06 03:22 PM
can excel draw a shape based on values entered in cells Milo Excel Worksheet Functions 1 April 6th 05 01:36 AM
changing comment indicator size or shape Mrocka Excel Worksheet Functions 1 December 13th 04 02:53 PM
Shape Size in Cell Mike Excel Programming 1 December 12th 03 07:48 PM


All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"