Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Shape Height Goes Down!

Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).

I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.

Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").[B23]

With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Shape Height Goes Down!

try rotating 180

Sub SpinButton3()
Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").[B23]

With ws.Shapes("AutoShape 1")
.Height = iLevel * 10
.IncrementRotation 180#
End With

End Sub


"Jason Morin" wrote:

Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).

I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.

Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").[B23]

With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Shape Height Goes Down!

jason - i got it to work with your original code, in the proper
direction.

i just had to change this line; you had [ ] around it......

iLevel = Sheets("Spin").Range("B1")

nifty idea, i had to try it out
:)
susan


On May 7, 12:56 pm, Joel wrote:
try rotating 180

Sub SpinButton3()
Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").[B23]

With ws.Shapes("AutoShape 1")
.Height = iLevel * 10
.IncrementRotation 180#
End With

End Sub



"Jason Morin" wrote:
Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).


I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.


Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long


Set ws = ActiveSheet


iLevel = Sheets("Spin").[B23]


With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With


End Sub- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Shape Height Goes Down!

???
Susan:Is the rotation bar pointing up or down? The height always moves away
from the rotation bar. the () or [] didn't make a difference on my excel
worksheet. when the rotation bar is on the top of the part, the part grows
down the page. when the rotation bar is on the bottom of the part, the part
grow up the page. where up is towards row 1 and down is toward row 65,536.

"Susan" wrote:

jason - i got it to work with your original code, in the proper
direction.

i just had to change this line; you had [ ] around it......

iLevel = Sheets("Spin").Range("B1")

nifty idea, i had to try it out
:)
susan


On May 7, 12:56 pm, Joel wrote:
try rotating 180

Sub SpinButton3()
Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").[B23]

With ws.Shapes("AutoShape 1")
.Height = iLevel * 10
.IncrementRotation 180#
End With

End Sub



"Jason Morin" wrote:
Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).


I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.


Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long


Set ws = ActiveSheet


iLevel = Sheets("Spin").[B23]


With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With


End Sub- Hide quoted text -


- Show quoted text -




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Shape Height Goes Down!

ummm, what rotation bar???

:)
i drew a cylinder auto shape, stuck your code in the worksheet module,
adapted it to fit my autoshape (1), inserted a CONTROL BOX spin
button, changed the cell link to b1, and voila!

yes, it moves upwards, towards row 1.
if you make it big enough that it's hitting the top of row 1, then it
moves downward instead.
the only problem i have with it is that the cylinder doesn't exactly
stay PUT while it's growing & shrinking. each time i increment the
spin button, it moves slightly up & to the left.

this is the code i put in:

Option Explicit

Private Sub SpinButton2_Change()

Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").Range("B1")

With ws.Shapes("AutoShape 1")
.Height = iLevel * 10
End With

'Joel said to try this, but it just makes for
'very interesting movement!
'With ws.Shapes("AutoShape 1")
' .Height = iLevel * 10
' .IncrementRotation 180#
'End With

End Sub


i commented out your code, & tried joel's, but all that does is flip
the shape around from top to bottom.
susan



On May 7, 1:51 pm, Joel wrote:
???
Susan:Is the rotation bar pointing up or down? The height always moves away
from the rotation bar. the () or [] didn't make a difference on my excel
worksheet. when the rotation bar is on the top of the part, the part grows
down the page. when the rotation bar is on the bottom of the part, the part
grow up the page. where up is towards row 1 and down is toward row 65,536.



"Susan" wrote:
jason - i got it to work with your original code, in the proper
direction.


i just had to change this line; you had [ ] around it......


iLevel = Sheets("Spin").Range("B1")


nifty idea, i had to try it out
:)
susan


On May 7, 12:56 pm, Joel wrote:
try rotating 180


Sub SpinButton3()
Dim ws As Worksheet
Dim iLevel As Long


Set ws = ActiveSheet


iLevel = Sheets("Spin").[B23]


With ws.Shapes("AutoShape 1")
.Height = iLevel * 10
.IncrementRotation 180#
End With


End Sub


"Jason Morin" wrote:
Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).


I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.


Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long


Set ws = ActiveSheet


iLevel = Sheets("Spin").[B23]


With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With


End Sub- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Shape Height Goes Down!

i'd be happy to send you the workbook if that would help..........
susan

On May 7, 2:10 pm, Susan wrote:
ummm, what rotation bar???

:)
i drew a cylinder auto shape, stuck your code in the worksheet module,
adapted it to fit my autoshape (1), inserted a CONTROL BOX spin
button, changed the cell link to b1, and voila!

yes, it moves upwards, towards row 1.
if you make it big enough that it's hitting the top of row 1, then it
moves downward instead.
the only problem i have with it is that the cylinder doesn't exactly
stay PUT while it's growing & shrinking. each time i increment the
spin button, it moves slightly up & to the left.

this is the code i put in:

Option Explicit

Private Sub SpinButton2_Change()

Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").Range("B1")

With ws.Shapes("AutoShape 1")
.Height = iLevel * 10
End With

'Joel said to try this, but it just makes for
'very interesting movement!
'With ws.Shapes("AutoShape 1")
' .Height = iLevel * 10
' .IncrementRotation 180#
'End With

End Sub

i commented out your code, & tried joel's, but all that does is flip
the shape around from top to bottom.
susan


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Shape Height Goes Down!

This code worked for me:

Private Sub SpinButton1_Change()
Dim iDiff As Long

Application.ScreenUpdating = False
iDiff = Me.Shapes("Cylinder").Height - Me.SpinButton1.Value
Me.Shapes("Cylinder").Height = Me.SpinButton1.Value
Me.Shapes("Cylinder").Top = Me.Shapes("Cylinder").Top + iDiff
Application.ScreenUpdating = True
End Sub

I added a Spinbutton to a worksheet and did not link it to a cell.
You can certainly link it to a cell if you wish.

Note that the bottom will change a small amount due to the bottom and top
getting "rounder", -this is due to the pseudo parallax being imposed on the
shape as it changes. But overall the impression is that the cylinder is
"growing" in the up direction.

Note that the top of screen is 0, positive direction is down, negative
direction is up.


If the orientation of the shape is changed, the code won't work, as is. You
would have to use trigonometry to determine the new settings based on the
rotation of the shape. Remember vectors?



"Jason Morin" wrote:

Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).

I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.

Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long

Set ws = ActiveSheet

iLevel = Sheets("Spin").[B23]

With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With

End Sub

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Shape Height Goes Down!

Private Sub SpinButton2_Change()

Dim iDiff As Long


Application.ScreenUpdating = False
iDiff = Me.Shapes("AutoShape 1").Height - Me.SpinButton2.Value
Me.Shapes("AutoShape 1").Height = Me.SpinButton2.Value
Me.Shapes("AutoShape 1").Top = Me.Shapes("AutoShape 1").Top +
iDiff
Application.ScreenUpdating = True

End Sub


variables changed to fit my sheet........
it works, as in goes up & down with the spin button, but the movement
of the shape is worse than it was previously.
with this code:


Private Sub SpinButton2_Change()

Dim ws As Worksheet
Dim shp As Shape
Dim sBottom As Single

Set ws = ActiveSheet
Set shp = ws.Shapes("AutoShape 1")

sBottom = shp.Top + shp.Height

Application.ScreenUpdating = False
shp.Height = Sheets("Spin").Range("B1") * 10
shp.Top = sBottom - shp.Height
Application.ScreenUpdating = True

Set shp = Nothing
Set ws = Nothing

End Sub


the shape stays put while going down, and moves slightly going up.
i'm using windows 2k XP & excel 2k.
i've seen something in the newsgroup about this issue of moving up &
to the left.... but darned if i can find anything right this minute.
:)
susan



On Jun 26, 7:32 pm, Steve the large
wrote:
This code worked for me:

Private Sub SpinButton1_Change()
Dim iDiff As Long

Application.ScreenUpdating = False
iDiff = Me.Shapes("Cylinder").Height - Me.SpinButton1.Value
Me.Shapes("Cylinder").Height = Me.SpinButton1.Value
Me.Shapes("Cylinder").Top = Me.Shapes("Cylinder").Top + iDiff
Application.ScreenUpdating = True
End Sub

I added a Spinbutton to a worksheet and did not link it to a cell.
You can certainly link it to a cell if you wish.

Note that the bottom will change a small amount due to the bottom and top
getting "rounder", -this is due to the pseudo parallax being imposed on the
shape as it changes. But overall the impression is that the cylinder is
"growing" in the up direction.

Note that the top of screen is 0, positive direction is down, negative
direction is up.

If the orientation of the shape is changed, the code won't work, as is. You
would have to use trigonometry to determine the new settings based on the
rotation of the shape. Remember vectors?



"Jason Morin" wrote:
Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).


I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.


Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long


Set ws = ActiveSheet


iLevel = Sheets("Spin").[B23]


With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With


End Sub- Hide quoted text -


- Show quoted text -



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Shape Height Goes Down!

aha!

http://groups.google.com/group/micro...41aaad24117b80

if you anchor the shape, it stops moving (other than up & down like
it's supposed to)!

Private Sub SpinButton2_Change()

Dim ws As Worksheet
Dim shp As Shape
Dim sBottom As Single

Set ws = ActiveSheet
Set shp = ws.Shapes("AutoShape 1")

With ws.Shapes("AutoShape 1")
.Left = .Parent.Columns(3).Left
End With

sBottom = shp.Top + shp.Height

Application.ScreenUpdating = False
shp.Height = Sheets("Spin").Range("B1") * 10
shp.Top = sBottom - shp.Height
Application.ScreenUpdating = True

Set shp = Nothing
Set ws = Nothing

End Sub

:D
susan



On Jun 27, 9:12 am, Susan wrote:
Private Sub SpinButton2_Change()

Dim iDiff As Long

Application.ScreenUpdating = False
iDiff = Me.Shapes("AutoShape 1").Height - Me.SpinButton2.Value
Me.Shapes("AutoShape 1").Height = Me.SpinButton2.Value
Me.Shapes("AutoShape 1").Top = Me.Shapes("AutoShape 1").Top +
iDiff
Application.ScreenUpdating = True

End Sub

variables changed to fit my sheet........
it works, as in goes up & down with the spin button, but the movement
of the shape is worse than it was previously.
with this code:

Private Sub SpinButton2_Change()

Dim ws As Worksheet
Dim shp As Shape
Dim sBottom As Single

Set ws = ActiveSheet
Set shp = ws.Shapes("AutoShape 1")

sBottom = shp.Top + shp.Height

Application.ScreenUpdating = False
shp.Height = Sheets("Spin").Range("B1") * 10
shp.Top = sBottom - shp.Height
Application.ScreenUpdating = True

Set shp = Nothing
Set ws = Nothing

End Sub

the shape stays put while going down, and moves slightly going up.
i'm using windows 2k XP & excel 2k.
i've seen something in the newsgroup about this issue of moving up &
to the left.... but darned if i can find anything right this minute.
:)
susan

On Jun 26, 7:32 pm, Steve the large



wrote:
This code worked for me:


Private Sub SpinButton1_Change()
Dim iDiff As Long


Application.ScreenUpdating = False
iDiff = Me.Shapes("Cylinder").Height - Me.SpinButton1.Value
Me.Shapes("Cylinder").Height = Me.SpinButton1.Value
Me.Shapes("Cylinder").Top = Me.Shapes("Cylinder").Top + iDiff
Application.ScreenUpdating = True
End Sub


I added a Spinbutton to a worksheet and did not link it to a cell.
You can certainly link it to a cell if you wish.


Note that the bottom will change a small amount due to the bottom and top
getting "rounder", -this is due to the pseudo parallax being imposed on the
shape as it changes. But overall the impression is that the cylinder is
"growing" in the up direction.


Note that the top of screen is 0, positive direction is down, negative
direction is up.


If the orientation of the shape is changed, the code won't work, as is. You
would have to use trigonometry to determine the new settings based on the
rotation of the shape. Remember vectors?


"Jason Morin" wrote:
Hello. I have a shape (cylinder) that changes height when I change the value
via a spin button. However, instead of the shape increasing in height, it
decreases from the base (i.e. the shape stretches down the worsheet as I
increase the value).


I need the cylinder to increase in height (upward), not down. Using XP
Office, XL2000. Thanks.


Private Sub SpinButton3_Change()
Dim ws As Worksheet
Dim iLevel As Long


Set ws = ActiveSheet


iLevel = Sheets("Spin").[B23]


With ws.Shapes("AutoShape 11")
.Height = iLevel * 10
End With


End Sub- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



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
Row Height stopped growing and Auot-Fit Row Height does not work PSULionRP Excel Discussion (Misc queries) 0 May 19th 09 07:59 PM
Evaluating if a Shape is a line or a shape Sanjay[_2_] Excel Programming 2 April 30th 07 08:21 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


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

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"