Excel Past Image from Clipboard

rachidaitali

New Member
Joined
Nov 10, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I need your help to create macro or something to be able to :

1-have a button in the middle of the cell
2- when pressing the button : it will past from clipboard to the cell and fit automatically in the middle without adjusting the size and properties.

I have tried the below but doesn't seems the picture fit the cell, it's all the time bigger.

Public Sub PastAndMove()

Const TargetRange = "A51:J57"

Dim s As Object

ActiveSheet.Paste
Set s = Selection.ShapeRange
s.Top = (Range(TargetRange).Height - s.Height) / 2 + Range(TargetRange).Top
s.Left = (Range(TargetRange).Width - s.Width) / 2 + Range(TargetRange).Left

End Sub

can you please have a look, much appreciate your support and help
 

Attachments

  • Snap21.jpg
    Snap21.jpg
    109.9 KB · Views: 5
  • Snap123.jpg
    Snap123.jpg
    187.3 KB · Views: 5

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Here is how to do it
 
Upvote 0
Welcome to the MrExcel Message Board! :)

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Excel Past Image from Clipboard
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Welcome to the MrExcel Message Board! :)

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Excel Past Image from Clipboard
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Apologize
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,148
Members
448,552
Latest member
WORKINGWITHNOLEADER

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