I'm playing around to try with a code like this :
Give the macro above to a button on a sheet if needed.
The user process is like this :
1. Select the cells to be copied as a picture
2. Click the button which has the macro with the code above OR run the code above via VBA editor
3. The code will ask the user to give the name of the picture
4. Type the name of the picture without extension
The code process is like this :
1. The selected cells is copied as picture
2. Create a new workbook
3. Paste the picture to the new workbook
4. Ask the user to input/type a name (say the name is pic001)
5. Save the new workbook as htm file in "D:/test/" folder
This will create "D:/test/pic001_files/" folder and create "D:/test/pic001.htm" file.
Inside "D:/test/pic001_files/", the copied cells image is automatically named to "image001.png"
6. Close the newly created workbook
7. Rename the "image001.png" to "pic001.png"
8. Move the "pic001.png" to "D:/test" folder
9. Delete the "D:/test/pic001_files/" folder
10. Delete the "D:/test/pic001.htm" file.
Please note that the code doesn't check if the same image file name already exist in "D:/test" folder.
So if the next time the user input "pic001" again, it will throw an error on step 8.
I've found on the internet there is another way by creating a chart which maybe is simpler than mine, but I haven't tried it yet.
Just now I'm playing around with the code I've found in the internet using chart :
Bookmarks