Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Associating Cell with Background Image

There is no easy way to do that. I think you would have to do some
intensive API work that identifies the color of the pixel on the screen,
then identifies which cell is at that pixel. Why not draw the circles using
the drawing toolbar.

--
Regards,
Tom Ogilvy

"ntegrat61" wrote in message
...
Can I make Excel relate a color in a picture to a cell?

First, I scanned into my computer hollow circles that were hand drawn.

Then, I filled them with red paint in Microsoft Paint. Then, I imported the
picture into Microsoft Excel two different ways: 1) to the background, and
2) to the
foreground.

I want to count every cell that contains red paint. I am using this VBA

function:

Function CountByColor(InputRange As Range, ColorRange as Range) As Long
Dim cl As Range, TempCount As Long, ColorIndex As Integer
ColorIndex = ColorRange.Cells(1, 1).Interior.ColorIndex
TempCount = 0
For Each cl In InputRange.Cells
If cl.Interior.ColorIndex = ColorIndex Then
TempCount = TempCount + 1
End If
Next cl
Set cl = Nothing
CountByColor = TempCount
End Function


However, Microsoft Excel recognizes every cell as being blank in both

cases. (That is, when the picture is in the background or foreground.) Can I
make Excel relate a color to a cell?

Michael



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
Dynamic background image in Excel? icystorm Excel Discussion (Misc queries) 2 February 2nd 10 03:32 AM
Excel background image [email protected] Excel Discussion (Misc queries) 0 December 17th 07 02:13 AM
Size of the background image? bkoren Excel Discussion (Misc queries) 0 January 9th 07 06:55 PM
image as a spreadsheet background melon Excel Discussion (Misc queries) 4 January 10th 05 05:48 PM
Export the worksheet background image as an image file - possible? DataFreakFromUtah Excel Programming 2 April 10th 04 04:49 PM


All times are GMT +1. The time now is 10:51 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"