Moving a Picture in excel with command buttons from one cell to another

Cquake

Board Regular
Joined
Dec 12, 2017
Messages
57
Office Version
  1. 2016
Platform
  1. Windows
First off I just want to thank those that have been a big help to me with my previous questions as I have already learned a lot from them. I am having problems finding the answer though to my latest dilemna. I have a picture I want to be able to move from one cell to another by many different increments. Example would be I want to move the picture just 3 cells say from CC18:CC21. The next move may be any number.

So overall I need the picture to move between cells CC18:DG16 using as I said different command button macros. This picture would also need to be able to move from DD16:CC18 with a macro command button making it change directions. Can this be done this way or is there a way to use an entry area for the number of cells I need it to move at any given time that would then also clear out the last entry.

Thanks,
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Re: Moving a Pitcure in excel with commang buttons from one cell to another

Try this:-
By using the code below (Place in worksheet module) and selecting a cell within the range (CC16:DG18) will position "Picture 1" (Change name to suit) in the top left of the cell selected.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("CC16:DG18")) Is Nothing Then
  With ActiveSheet.Shapes("Picture 1")
    .Top = Target.Top
    .Left = Target.Left
  End With
End If
End Sub
 
Upvote 0
Re: Moving a Pitcure in excel with commang buttons from one cell to another

Thanks

when assigning my macro button to that picture to move it would it be

Range("Picture1").value = Range(CC18:DD16).value +1
 
Upvote 0
Re: Moving a Pitcure in excel with commang buttons from one cell to another

I'm not sure what your getting at !!!
To use the code you just need to change the picture name in the code to Your picture name, then place the code into the sheet module, then when you select any cell in the Range "CC16:CD18" the "Picture" in the code will be positioned within the cell you've selected.
At the moment the Picture code module does not have any code and there are no Buttons!!!!
The code is designed so that you don't need lots of buttons to position the picture you just need to select a cell within the range "CC16:Cd18".
If you really want "Buttons", then you need to describe how you would like them to work to cover all the cells.

You could run the code from a "Combobox" or "Validation list", that allows you to select an individual cell from within the range"CC16:CD18", and on selection the Picture will move to the selected cell address.
Your Thoughts !!!!
 
Upvote 0
Re: Moving a Pitcure in excel with commang buttons from one cell to another

This works. Thanks for the help.
 
Upvote 0
Re: Moving a Pitcure in excel with commang buttons from one cell to another

You're welcome
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,617
Members
449,039
Latest member
Mbone Mathonsi

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