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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
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
 

Forum statistics

Threads
1,148,219
Messages
5,745,452
Members
423,952
Latest member
EduardoM

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
Top