Hello,
I'm working on a subroutine which generates and prints a report. Basically, I create a new worksheet, populate it with the relevant data, add some layout, send it to the printer, and finally remove the sheet again.
One of the layout features is the addition of various little icons, the number, type and location of which depend on the actual data. Because I prefer not to rely on external image files, I've included the icons as pictures on a hidden worksheet in the workbook. The idea is to copy the appropriate pictures while generating the report and put them in the correct spot on the sheet. It's this repositioning that is causing me problems.
The code I use is this:
Dim sheetReport as Worksheet
Dim rangeReference as Range
ThisWorkbook.Sheets(“Images”).Shapes("IconGrowth").Copy
sheetReport.Range(rangeReference.Offset(i,j)).PasteSpecial
This pastes the selected icon in the top left corner of the designated cell, which is not always exactly where I want it. What is the easiest way to, for example, move the pasted picture a few points to the left and down, so that it is in the center of the cell?
Thank you in advance for your advice!
nymm
Bookmarks