Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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
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
How can you anchor pictures to excel cells? Laura Excel Discussion (Misc queries) 5 May 10th 23 03:43 AM
Center All Pictures in Excel Cells Finny[_2_] Excel Discussion (Misc queries) 1 May 28th 10 05:27 AM
Can I anchor pictures to specific cells in Excel? nita Excel Discussion (Misc queries) 4 June 19th 08 10:30 AM
How do I import named pictures into corresponding cells in Excel? mjeb1999 Excel Discussion (Misc queries) 1 September 14th 07 08:57 PM
how do I embed/Link pictures onto excel database cells? a0relento Excel Discussion (Misc queries) 0 October 14th 05 05:27 AM


All times are GMT +1. The time now is 08:23 AM.

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

About Us

"It's about Microsoft Excel"