View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default Using Pictures to return numeric totals

Hi,

Although you need to have unique names for the pictures you will need to
keep some part of the name consistent in order to count duplicates of the
same picture.
Let's assume the pictures are about the type of pets a person has. Available
choices are Dog, Cat, Fish or Bird.
You would need 10 Dog pictures named "Dog1", "Dog2", "Dog3"..... "Dog10"
10 Cat pictures named "Cat1","Cat2"..."Cat10"
hopefully you get the idea.

Now you can identify the type of picture from it's name. And depending on
how the pictures are being displayed on the sheet the number of each type.

The other bit of information you may need if the TopLeftCell property of the
picture in order to locate it's position on the worksheet.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"matt3542" wrote in message
...
Hi Peter, apologies for the confusion, perhaps frequency was the wrong way
of
referencing what I meant. There are 10 cells for any given employee entity
with 7 possible pictures (obviously some will appear more than once) and
all
the pictures have been given a unique name via the name box. Before
pasting
the pictures into the cells I made sure each cell was selected and I have
not
re-positioned manually. Admittedly I had not thought of using the picture
type fonts because the type of pictures I have used have a relevance to
what
is being conveyed. I hope this clarifies things a little better, hope to
hear
back from you. Thanks, Matt

"Peter T" wrote:

What do you mean by pictures can appear in any frequency. Whilst there
may
be several copies of a particular picture on a sheet, each name will be
different, which means they are in effect different pictures which happen
to
look the same. (There is an almost accidental way to have pictures with
duplicate names but that only follows a certain scenario.

You could perhaps name similar pictures something like
PicA_001.pic, PicA_002.pic
then you'd know that pictures with prefix "PicA_" are equivalent pictures

Secondly, pictures do not "belong" to cells though top-left &
bottom-right
cell locations are easily returned. If for your idea to have any chance
of
working you'd need to be sure that say a picture's top-left corner really
is
located within your cell, not say slightly above or to the left. Easy for
a
picture to get nudged slightly off the cell you think it's in.

Subject to clarifying the above, something along the lines of what you
are
asking might be possible. Have you considered working with one of the
various picture type fonts which might lead to an equivalent solution
much
more easily (just type in a letter), quickly (in terms of processing) and
not least reliably (no ambiguity about which character(s) exist in which
cells).

Regards,
Peter T

"matt3542" wrote in message
...
Dear Forum Members,

I am trying to achieve something rather abstract using VBA code and I'm
not
entirely sure if its possible, hence any help would be greatly
appreciated.
Instead of using numeric values in cells I have represented some data
pictorially (by pasting various .jpg's on top of cells) and would like
to
use a command button to determine the total number of times the picture
occurs for a given employee and display the results in cells B18:H18*

Jbloggs1 Pic1(B5) Pic2(C5) Pic3(D5) Pic4(E5) Pic5(F5)..to Pic7(K5)

CmdBtnJbloggs1 *TotalPic1 TotalPic2 TotalPic3 TotalPic4...

There are 7 pics that can appear in any order/frequency up to a maximum
of
10 times on top of cells B5:K5. I have also changed the name of the
pics
to
those given above. Does anyone know if this is possible? Any help would
be
fantastic, Many thanks, Matt