Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pictures in Cells in Excel?
Any way to make a picture stick/bind to a cell in Excel.
The handheld auditing program we use exports the data, including photos to excel fine, and places the picture over the cell intended, top and left. I know how to resize it to the size of the cell, but want to make it a bit smaller than the cell and centre it on the cell to give a small border of white space around it. I can make it smaller than the cell, but its still top and left aligned to the cell. the only alignment adjustments I can find work in relation to the sheet, and not to a cell? Working in Excel 2000 (that's what my users have) Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pictures in Cells in Excel?
Sub Tester2()
Dim pic As OLEObject Dim rng As Range Dim lBorder As Long lBorder = 8 For Each pic In ActiveSheet.Pictures Set rng = pic.TopLeftCell pic.Top = rng.Top + lBorder pic.Left = rng.Left + lBorder pic.Width = rng.Width - 2 * lBorder pic.Height = rng.Height - 2 * lBorder Next End Sub -- Regards, Tom Ogilvy Joe 90 wrote in message ... Any way to make a picture stick/bind to a cell in Excel. The handheld auditing program we use exports the data, including photos to excel fine, and places the picture over the cell intended, top and left. I know how to resize it to the size of the cell, but want to make it a bit smaller than the cell and centre it on the cell to give a small border of white space around it. I can make it smaller than the cell, but its still top and left aligned to the cell. the only alignment adjustments I can find work in relation to the sheet, and not to a cell? Working in Excel 2000 (that's what my users have) Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pictures in Cells in Excel?
Thanks
Will give it a go "Tom Ogilvy" wrote in message ... Sub Tester2() Dim pic As OLEObject Dim rng As Range Dim lBorder As Long lBorder = 8 For Each pic In ActiveSheet.Pictures Set rng = pic.TopLeftCell pic.Top = rng.Top lBorder pic.Left = rng.Left lBorder pic.Width = rng.Width - 2 * lBorder pic.Height = rng.Height - 2 * lBorder Next End Sub -- Regards, Tom Ogilvy Joe 90 wrote in message ... Any way to make a picture stick/bind to a cell in Excel. The handheld auditing program we use exports the data, including photos to excel fine, and places the picture over the cell intended, top and left. I know how to resize it to the size of the cell, but want to make it a bit smaller than the cell and centre it on the cell to give a small border of white space around it. I can make it smaller than the cell, but its still top and left aligned to the cell. the only alignment adjustments I can find work in relation to the sheet, and not to a cell? Working in Excel 2000 (that's what my users have) Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pictures in Cells in Excel?
Tom
Couldn't get this code to work, but was able to fix it by using: mydocument = Worksheets(1) For Each sh in mydocument.Shapes and changing all the "pic" to "sh" I still cannot figure out how to select a single shape based upon the range it is in? e.g. if a picture is completely inside a cell, and this is the activecell, how do I then select the picture within the cell with code? (assume I have many rows each with a picture inside a cell) and I want to work on only one picture, not the shapes collection. regards Joe "Tom Ogilvy" wrote in message ... Sub Tester2() Dim pic As OLEObject Dim rng As Range Dim lBorder As Long lBorder = 8 For Each pic In ActiveSheet.Pictures Set rng = pic.TopLeftCell pic.Top = rng.Top lBorder pic.Left = rng.Left lBorder pic.Width = rng.Width - 2 * lBorder pic.Height = rng.Height - 2 * lBorder Next End Sub -- Regards, Tom Ogilvy Joe 90 wrote in message ... Any way to make a picture stick/bind to a cell in Excel. The handheld auditing program we use exports the data, including photos to excel fine, and places the picture over the cell intended, top and left. I know how to resize it to the size of the cell, but want to make it a bit smaller than the cell and centre it on the cell to give a small border of white space around it. I can make it smaller than the cell, but its still top and left aligned to the cell. the only alignment adjustments I can find work in relation to the sheet, and not to a cell? Working in Excel 2000 (that's what my users have) Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can you anchor pictures to excel cells? | Excel Discussion (Misc queries) | |||
Center All Pictures in Excel Cells | Excel Discussion (Misc queries) | |||
Can I anchor pictures to specific cells in Excel? | Excel Discussion (Misc queries) | |||
How do I import named pictures into corresponding cells in Excel? | Excel Discussion (Misc queries) | |||
how do I embed/Link pictures onto excel database cells? | Excel Discussion (Misc queries) |