Excel as database with images in column:
I would like to make a tool which allows in one sheet the selection of products, all the necessary discount calculations and then print the selection as a quotation for a customer. The table is filtered and then the visible rows copied to another table ready for printing. One of the columns contains images. Images are wisely attached to the cells ("move but NOT size with cells")
- if I filter them, images failed to be filtered, they get superimposed.
- if after filtering I would like to copy them to another table, formatted for printing. They land in accidental locations, not in cell positions where I would like them to land.
Is there a solution to copy and paste images in excel exactly as they are, without changing location and size (attached to destination Cells with VBA?
=== What i tried:
- The user filters records in a table s/he would like to include in a quotation.
By pressing a button s/he runs a macro. It first cleans all drawings and data in target table to which the records will be copied. Then text is copied separately and images separately to their destination columns with the code:
With Sheets ("QuotationPrint")
'copy descriptions Sheets("oferta stal").ListObjects("tblPricelist").ListColumns("Descriptions").DataBodyRange.SpecialCells(xlCellTypeVisible).Copy .Range("c8").PasteSpecial Paste:=xlPasteAllUsingSourceTheme ', SkipBlanks:=True 'copy images Sheets("oferta stal").ListObjects("tblPricelist").ListColumns("images").DataBodyRange.SpecialCells(xlCellTypeVisible).Copy .Range("o8").Select ActiveSheet.Paste .Columns("H:I").Hidden = True .Range("n8:n300").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True .Range("c8:c300").SpecialCells(xlCellTypeVisible).EntireRow.AutoFit End With
Here my skills end. What to do to avoid distortion of copied images?
EDIT:
Example data would contain here two columns (for simplifiaction purposes) 1 Table name (listobject.table or data table created with Ctrl+t) is 'tblPriceList.
Descriptions | images
------------------------
Lorem ipsum..| image1
Lorem muspi..| image2
meroL ipsum..| image3
Images are pasted and then they are attached to cell with option "Move but not resize with cell" The user uses filter to select, say row 1 and row 3. then the macro copies selected cells to new empty range starting with (O,8) in antother sheet. After data is pasted cells height are adjusted.
Here is reproducible example excel file showing the problem. Data is first filtered by user. Images fail to get filtered and get copied incorrectly: https://drive.google.com/open?id=1bGXuB47dFqhp9wsYcuBTB7Se6gelPnok