Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
???
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Row Height stopped growing and Auot-Fit Row Height does not work | Excel Discussion (Misc queries) | |||
Evaluating if a Shape is a line or a shape | Excel Programming | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |