How to create a drop down list that will move a shape from cell to cell

Cquake

Board Regular
Joined
Dec 12, 2017
Messages
57
Office Version
  1. 2016
Platform
  1. Windows
I am currently using macros to move my shape from cell to cell but am wanting to change the way I do that by using a drop down list to move it instead. The green shapes move it forward by the number of cells listed while the red does reverse. Each row width is set at 0.94. Here is the code I am presently using for the individual macros that move the ball. I have looked around the site but have not been able to find anything on this subject for using drop down list to move shapes. The home ball and visitor ball each have there own macro's for now. The drop down list would have numbers from -5 up to 80. Visitor always moves left to right and home right to left

Sub HOMENEGATIVE5()
'
' HOMENEGATIVE5 Macro
'
Current_Left = ActiveSheet.Shapes("Picture 39").Left
ActiveSheet.Shapes("Picture 39").Left = Current_Left + 45
'
End Sub


1596384645847.png
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
You would add data validation (drop down box) to a cell with the desired + / - yardages in it and use this worksheet change event:

VBA Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
     Dim Current_Left As Single
     If Not Intersect(Range("F5"), Target) Is Nothing Then
         Current_Left = ActiveSheet.Shapes("Picture 39").Left
         ActiveSheet.Shapes("Picture 39").Left = Current_Left + 9 * Target
     End If
End Sub

The code would go on the codepage of the worksheet that contains the graphic and drop down box
For this example F5 is the cell that contains the drop down box
 
Upvote 0
Thank you very much for your help. This site has helped me learn and to all I truely thank each and everyone of you.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,756
Members
448,990
Latest member
Buzzlightyear

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