ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel: How do I count the number of pictures in an excel cell? (https://www.excelbanter.com/excel-discussion-misc-queries/101125-excel-how-do-i-count-number-pictures-excel-cell.html)

John of Fyfett

Excel: How do I count the number of pictures in an excel cell?
 
I have access to publically available data that contains "ticks" in cells. I
can copy the data across to Excel and the ticks appear as pictures, all
neatly arranged in the appropriate cell. One tick - one picture, two ticks -
two pictures, there can be up to three ticks / pictures per cell. I can count
them and enter the number of ticks manually but this is time consuming and
liable to mistakes.

Any suggestions?

Bernie Deitrick

Excel: How do I count the number of pictures in an excel cell?
 
John,

The first macro below will put the count into the column to the right of the cells with the shapes,
and leave the shapes alone. The second macro will put the count into the cell with the shapes, and
remove the shapes.

HTH,
Bernie
MS Excel MVP

Sub CountShapes()
Dim mySh As Shape

For Each mySh In ActiveSheet.Shapes
mySh.TopLeftCell.Value = mySh.TopLeftCell.Value + 1
Next
End Sub

Sub CountAndRemoveShapes()
Dim mySh As Shape

For Each mySh In ActiveSheet.Shapes
mySh.TopLeftCell.Value = mySh.TopLeftCell.Value + 1
mySh.Delete
Next
End Sub


"John of Fyfett" <John of wrote in message
...
I have access to publically available data that contains "ticks" in cells. I
can copy the data across to Excel and the ticks appear as pictures, all
neatly arranged in the appropriate cell. One tick - one picture, two ticks -
two pictures, there can be up to three ticks / pictures per cell. I can count
them and enter the number of ticks manually but this is time consuming and
liable to mistakes.

Any suggestions?





All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com