+ Reply to Thread
Results 1 to 31 of 31

Excel Past Image from Clipboard

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Excel Past Image from Clipboard

    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.

    you help is much appreciated
    Attached Images Attached Images

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    Always in the same target range? How about this:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    Quote Originally Posted by WideBoyDixon View Post
    Always in the same target range? How about this:

    Please Login or Register  to view this content.
    WBD
    It would be great if you can send me all the steps on how to create the Button and then attribute it to the macro. I am new on Excel and your help and support is much appreciated.

    I have attached a screenshot from what i got and it didn't fit the required cell. do i need to change something in the Macro?
    Last edited by Rachidlea; 11-10-2021 at 01:05 PM.

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    Press Alt+F11 to bring up the VBA code editor. Go to the menu and Insert a new Module. Paste the above code into the module and close the VBA editor.
    Back on your sheet, make sure you have the Developer tab visible then click the Insert button on the toolbar and insert a new Button from the Form Controls section. It will prompt which macro you want to execute so just pick the "PastAndMove" macro that you created.

    WBD

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    Quote Originally Posted by WideBoyDixon View Post
    Press Alt+F11 to bring up the VBA code editor. Go to the menu and Insert a new Module. Paste the above code into the module and close the VBA editor.
    Back on your sheet, make sure you have the Developer tab visible then click the Insert button on the toolbar and insert a new Button from the Form Controls section. It will prompt which macro you want to execute so just pick the "PastAndMove" macro that you created.

    WBD
    Thank you WBD, i have tried....i was able to copy/past but the image was out of the required cell. i have attached a new picture to show you.

  6. #6
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    You still here, please need your help

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    Quote Originally Posted by Rachidlea View Post
    Thank you WBD, i have tried....i was able to copy/past but the image was out of the required cell. i have attached a new picture to show you.
    What new picture? Can you post the file and a sample image?

    WBD

  8. #8
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    Quote Originally Posted by WideBoyDixon View Post
    What new picture? Can you post the file and a sample image?

    WBD
    Hello WBD

    please find attached excel file and picture image. i would like to have this picture to fit in A51:J57.

    your help is much appreciated.
    ThanksAttachment 754964
    Attached Images Attached Images
    Attached Files Attached Files

  9. #9
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    Give it another try with this version.

    WBD
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    Hello WBD,

    still same and even the Macro is not working

    can you please check it

  11. #11
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    I did check it and it was working. See attached GIF.

    WBD
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    that is perfect, can you please change the name and send me another copy or just zip it?

    much appreciate

  13. #13
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    That's the file I attached previously in post #9.

    WBD

  14. #14
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    this is what i am getting. i am sure what going on.

    sorry about that
    Attached Images Attached Images

  15. #15
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    I think the clipboard is causing the problem. How about inserting the image by selecting a file?

    Please Login or Register  to view this content.
    WBD

  16. #16
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    is t a new macro i need to use ?

  17. #17
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    Code as above - just replace it.

    WBD

  18. #18
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    not sure what i am doing but this what i am getting. i have tried to download the same file you give me and still some issue. i think there is another coding. can you please verify and send another one.

    sorry about that.

    thank in advance
    Attached Images Attached Images

  19. #19
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    I've implemented the updated macro in the attached workbook.

    WBD

  20. #20
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Excel Past Image from Clipboard

    WBD's code from post #9 worked fine for me, I removed the format part of the line.

    I just copied the image from the previous post #8 and went to the worksheet and clicked the button.

    Please Login or Register  to view this content.
    The error you are displaying in Post #18 is from a different Code.
    Please Login or Register  to view this content.
    you don't have a sheet named "sheet1"

    If you want to add a sheet after your last sheet.
    Please Login or Register  to view this content.
    Copying A1 Current region
    Please Login or Register  to view this content.
    A1 has no cells surrounding it. So A1.current region would just be A1

  21. #21
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    I am still trying to get the one from post-9 to work but without success as this is the one i am more interested about.

    can i ask you a favour and try to rename the file, update it and send it back to me please?

    what about this module 1 and 2, also i can see macro in sheet1 [first day] ?

    which one is correct,

    thanks in advance
    Attached Images Attached Images

  22. #22
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33
    Hello

    Can you please help.
    Last edited by davesexcel; 11-13-2021 at 08:38 AM. Reason: Quoting previous post are not required

  23. #23
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Excel Paste Image from Clipboard

    Your post topic is about pasting an image into a specific range.
    If you have a different topic, then start a new thread.

    If the macro is not working for you, then you need to provide all the info.

    Copy an image, then go to the sheet and click the button, the picture will go into the specific range.
    Attached Files Attached Files

  24. #24
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    thank you, all working.

    much appreciate your help

  25. #25
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    @davesexcel : can you please do me a favor, i have just changed the shape of the template and tried the same macro but it's not fitting anymore into the Cell.

    can you show me how to adjust the macro to be able the picture fit into one cell. thanks in advance

    i have attached the new excel template
    Attached Files Attached Files

  26. #26
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Excel Past Image from Clipboard

    If you want to have the picture fit in the range, we need to unlock LockAspectRatio.

    Here is the code to fit the pic in the range after copying.

    Please Login or Register  to view this content.
    I also have a short You Tube clip on this explaining LockAspectRation

    Insert a picture into a range clip
    Attached Files Attached Files

  27. #27
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    thank you very much

    much appreciated

  28. #28
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    @davesexcel, do you think we can do the same macro for WORD. i want to have the same thing for my report in word ??

    will be great if someone can help

    Thanks in advance
    Attached Files Attached Files
    Last edited by Rachidlea; 11-15-2021 at 02:32 PM.

  29. #29
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Excel Past Image from Clipboard

    Ask in a word forum

  30. #30
    Registered User
    Join Date
    06-26-2013
    Location
    UK
    MS-Off Ver
    Microsoft 365 Entreprise
    Posts
    33

    Re: Excel Past Image from Clipboard

    Hello Davesexcel and all,

    sorry to bother you guys again but need you help.

    I would like to hide a complete rows when i select N/A from drop down menu, can you please show me how to do that ?

    i have attached screenshot and also the the excel project.

    much appreciated

    Thanks
    Attached Images Attached Images
    Attached Files Attached Files

  31. #31
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Excel Past Image from Clipboard

    I think you need to raise this as a new question.

    WBD

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Add Clipboard Image to UserForm
    By Keags in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-18-2022, 05:28 AM
  2. Copy range from multiple workbooks and past as image in PPT
    By Mad-Dog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2017, 10:27 AM
  3. [SOLVED] Copy userform to clipboard as image
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2016, 09:02 AM
  4. Is there command to save clipboard as [image] file
    By riwiseuse in forum Excel General
    Replies: 0
    Last Post: 06-05-2016, 01:12 PM
  5. Copying an image into the clipboard
    By Omri6 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2008, 03:32 AM
  6. How to Past an Image from Excel 2000 into MS Outlook 2000
    By ExcelG.I.T in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2005, 02:55 PM
  7. [SOLVED] Clipboard doesn't past properly
    By Glenn in forum Excel General
    Replies: 0
    Last Post: 07-12-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1