![]() |
Copy Image using VBA
Hi there,
I am trying to programatically copy a picture from one Excel worksheet to another in a same workbook, but don't know how. I found a piece of code from this newsgroup that shows how to copy a picture from outside of the workbook, but not within. Range("D2").Select ActiveSheet.Pictures.Insert ("C:\Pic1") Can someone please advice? Thank you for your help! Lin |
Copy Image using VBA
On Mar 19, 1:17 pm, wrote:
Hi there, I am trying to programatically copy a picture from one Excel worksheet to another in a same workbook, but don't know how. I found a piece of code from this newsgroup that shows how to copy a picture from outside of the workbook, but not within. Range("D2").Select ActiveSheet.Pictures.Insert ("C:\Pic1") Can someone please advice? Thank you for your help! Lin Do you just have one picture? If so, this should work. If you have more than one pic, you should record a macro for the copy portion then just use the second line of this to paste your pic... ActiveSheet.Pictures.Copy Sheets("Sheetnamehere").Range("D2").PasteSpecial |
Copy Image using VBA
Thank you! It works!
Lin On Mar 19, 1:35 pm, "okrob" wrote: On Mar 19, 1:17 pm, wrote: Hi there, I am trying to programatically copy a picture from one Excel worksheet to another in a same workbook, but don't know how. I found a piece of code from this newsgroup that shows how to copy a picture from outside of the workbook, but not within. Range("D2").Select ActiveSheet.Pictures.Insert ("C:\Pic1") Can someone please advice? Thank you for your help! Lin Do you just have one picture? If so, this should work. If you have more than one pic, you should record a macro for the copy portion then just use the second line of this to paste your pic... ActiveSheet.Pictures.Copy Sheets("Sheetnamehere").Range("D2").PasteSpecial- Hide quoted text - - Show quoted text - |
All times are GMT +1. The time now is 05:12 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com