Value properties on commandbutton

vwxyz

New Member
Joined
Jan 10, 2005
Messages
3
Dear expert,

I develop picture, line and commandbutton on ms excel
i want to make the commandbutton position possible move dynamicaly,
it position top and left value base on calculation result on cell
(example A1 value for top and A2 value for left)
other example the commandbutton fist position on C row
and then base on value A1 and A2 commandbutton move to F row
otomaticaly A1 and A2 value change.

is it posible to do that

:oops:

thanks very much before
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You will need to change this to match what you want, but try this:

Press Alt-F11.
Double-click on the sheet you want to attach this to in the left pane.
Paste this into the right pane:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1 Then
CommandPosition = [a1].Value
Select Case CommandPosition
Case 1
ActiveSheet.Shapes("CommandButton1").Select
Selection.ShapeRange.IncrementLeft -391.5
Selection.ShapeRange.IncrementTop 102#
Case Else
ActiveSheet.Shapes("CommandButton1").Select
Selection.ShapeRange.IncrementLeft 391.5
Selection.ShapeRange.IncrementTop -102#
End Select
[a1].Select
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,825
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top