Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting .bmp image using VLOOKUP


I have a data table with 10 columns (=10 properties) and 30 rows of dat
from my test samples. I have listed the names of the test images in th
data table Column F as "test1", "test2", and so on. On my harddisk
have stored the images corresponding to the tests i
"C:\CTParts\test1.bmp, test2.bmp,...".

Below this data table, I have a report table with multiple rows o
data. The report table uses validation list (referencing data tabl
column A) and fills some of the remaining cells in the report's rows b
using the VLOOKUP function.

What I would like to do is to retrieve the .bmp image corresponding t
the Column F value in the report table, (E.g. Column F row 35 value b
VLOOKUP is "test1", then Column F row 35 will display the imag
test1.bmp retrieved from "C:\CTParts"), and resize the row's height t
fit the image height. All images have a fixed width but differen
heights. The images need to be shrunk to 25% of their size, whil
maintaining their aspect ratio and centered in the column.

Any help would be appreciated.
Shan

--
shasha
-----------------------------------------------------------------------
shashak's Profile: http://www.excelforum.com/member.php...fo&userid=1626
View this thread: http://www.excelforum.com/showthread.php?threadid=27668

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Inserting .bmp image using VLOOKUP

Hi
maybe try:
http://www.mcgimpsey.com/excel/lookuppics.html

--
Regards
Frank Kabel
Frankfurt, Germany

"shashak" schrieb im Newsbeitrag
...

I have a data table with 10 columns (=10 properties) and 30 rows of

data
from my test samples. I have listed the names of the test images in

the
data table Column F as "test1", "test2", and so on. On my harddisk I
have stored the images corresponding to the tests in
"C:\CTParts\test1.bmp, test2.bmp,...".

Below this data table, I have a report table with multiple rows of
data. The report table uses validation list (referencing data table
column A) and fills some of the remaining cells in the report's rows

by
using the VLOOKUP function.

What I would like to do is to retrieve the .bmp image corresponding

to
the Column F value in the report table, (E.g. Column F row 35 value

by
VLOOKUP is "test1", then Column F row 35 will display the image
test1.bmp retrieved from "C:\CTParts"), and resize the row's height

to
fit the image height. All images have a fixed width but different
heights. The images need to be shrunk to 25% of their size, while
maintaining their aspect ratio and centered in the column.

Any help would be appreciated.
Shank


--
shashak
---------------------------------------------------------------------

---
shashak's Profile:

http://www.excelforum.com/member.php...o&userid=16265
View this thread:

http://www.excelforum.com/showthread...hreadid=276683


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Inserting .bmp image using VLOOKUP

Shank,

You could use the calculate event code, though you would want to have
another
column where you could store the current picture name and prevent
reloading pictures that are already opened. This, at least, should get you
going.
The values from column F are stored in column T, but that is easily changed.

Copy the code, right-click on the sheet tab (assumed to be named Sheet1)
and select "View Code" and then paste the code in the window that appears.

This was tested on JPG, not BMP, files, all that I had, and it worked fine.

HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Calculate()
Dim myCell As Range

If ActiveSheet.Name < "Sheet1" Then Exit Sub

Application.EnableEvents = False

On Error Resume Next

For Each myCell In Range("F1:F30")

If myCell.Value < myCell(1, 15).Value Then

myCell(1, 15).Value = myCell.Value

myName = "C:\CTParts\" & myCell.Value & ".bmp"

With ActiveSheet
.Shapes("Shape" & myCell.Address).Delete
myCell.Select
.Pictures.Insert(myName).Select
Selection.Name = "Shape" & myCell.Address
Selection.ShapeRange.ScaleWidth 0.25, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.25, msoFalse, msoScaleFromTopLeft
myCell.EntireRow.RowHeight = Selection.ShapeRange.Height
myCell.Select
End With

End If
Next myCell

Application.EnableEvents = True
End Sub



"shashak" wrote in message
...

I have a data table with 10 columns (=10 properties) and 30 rows of data
from my test samples. I have listed the names of the test images in the
data table Column F as "test1", "test2", and so on. On my harddisk I
have stored the images corresponding to the tests in
"C:\CTParts\test1.bmp, test2.bmp,...".

Below this data table, I have a report table with multiple rows of
data. The report table uses validation list (referencing data table
column A) and fills some of the remaining cells in the report's rows by
using the VLOOKUP function.

What I would like to do is to retrieve the .bmp image corresponding to
the Column F value in the report table, (E.g. Column F row 35 value by
VLOOKUP is "test1", then Column F row 35 will display the image
test1.bmp retrieved from "C:\CTParts"), and resize the row's height to
fit the image height. All images have a fixed width but different
heights. The images need to be shrunk to 25% of their size, while
maintaining their aspect ratio and centered in the column.

Any help would be appreciated.
Shank


--
shashak
------------------------------------------------------------------------
shashak's Profile:

http://www.excelforum.com/member.php...o&userid=16265
View this thread: http://www.excelforum.com/showthread...hreadid=276683



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting an image into a cell Trent SC Excel Discussion (Misc queries) 2 April 11th 08 11:37 AM
Inserting an image into a cell Trent SC New Users to Excel 2 April 11th 08 11:37 AM
Inserting an Image or Line BigPig Excel Discussion (Misc queries) 7 February 10th 06 02:14 AM
Inserting an image or line BigPig Excel Worksheet Functions 0 February 9th 06 07:24 PM
inserting image and document files into the spreadsheet Cornpone Excel Discussion (Misc queries) 7 January 30th 06 12:50 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"