How do Count how many shapes are on a sheet?

%3CLINGO-SUB%20id%3D%22lingo-sub-287599%22%20slang%3D%22en-US%22%3EHow%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287599%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone%2C%20I%20need%20help%20with%20this%20issue%2C%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-287599%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-293294%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-293294%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Jamil%2C%3C%2FP%3E%3CP%3EThank%20you%20again%20for%20your%20answer%20and%20help.%3C%2FP%3E%3CP%3EWe%20thought%20we%20were%20using%20also%20original%20shapes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20How%20could%20we%20assign%20a%20shape%20name%20to%20each%20different%20one%3F%3C%2FP%3E%3CP%3E2)%20Which%20are%20the%20%22original%20Excel%20built-in%20shapes%22%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETx%2C%20Juan%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-293268%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-293268%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EI%20can%20see%20that%20you%20are%20only%20using%20images.%20not%20the%20original%20Excel%20built-in%20shapes.%3CBR%20%2F%3EHowever%2C%20it%20is%20possible%20to%20count%20the%20specific%20images%2C%20but%20they%20need%20to%20be%20named%20properly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Efor%20example%20these%20two%20images%20have%20the%20same%20name%26nbsp%3BGr%C3%A1fico%20373%20%26amp%3B%20Gr%C3%A1fico%20375%26nbsp%3B%20if%20you%20want%20them%20to%20be%20counted%20seperately%20then%20you%20need%20to%20name%20each%20type%20differently%2C%20regardless%20of%20it%20is%20number%2C%20but%20the%26nbsp%3B%3CSPAN%3EGr%C3%A1fico%26nbsp%3Bto%20be%20replaced%20with%20something%26nbsp%3Belse.%20similarly%20for%20other%20image%20objects%20as%20well.%20each%20of%20them%20should%20have%20a%20unique%26nbsp%3Bname%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22dg.jpg%22%20style%3D%22width%3A%2058px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F61067iA426DE9C52537040%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22dg.jpg%22%20alt%3D%22dg.jpg%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22as.jpg%22%20style%3D%22width%3A%2050px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F61069iBC8E565250BF4CBF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22as.jpg%22%20alt%3D%22as.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Efor%20example%20this%20one%20bulb%201%20and%26nbsp%3Bbulb%202%20for%20the%20second%20image%20like%20this%20and%20then%26nbsp%3Bbulb%203%20for%20third%20and%20so%20on.%26nbsp%3B%20so%20the%26nbsp%3Bbulb%20name%20should%20only%20be%20used%20for%20this%20image.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22as.jpg%22%20style%3D%22width%3A%2050px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F61069iBC8E565250BF4CBF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22as.jpg%22%20alt%3D%22as.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-292623%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-292623%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20friend%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20you%20are%20fine.%20we%20have%20reviewed%20the%20excel%20to%20assign%20shapes%20to%20all%20items%20we%20would%20like%20to%20count%20instead%20of%20mixing%20images%20and%20shapes.%20Even%20though%20some%20of%20them%20are%20still%20marked%20with%20an%20image.%20The%20image%20will%20serve%20to%20guide%20us%20from%20a%20visual%20point%20of%20view.%20However%20the%20shapes%20can%20give%20us%20an%20idea%20of%20how%20many%20items%20will%20have%20to%20count.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20would%20be%20fantastic%20if%20we%20could%20make%20a%20macro%20that%20counts%20the%20items%20per%20floor.%20We%20have%20tried%20to%20do%20the%20%26nbsp%3Bplans%20separated%20so%20that%20the%20surface%20could%20be%20the%20limited%20for%20each%20floor.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20columns%20K%20and%20L%20you%20have%20the%20shapes%20that%20we%20would%20like%20to%20count.%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20feel%20free%20to%20send%20us%20any%20suggestion%20that%20could%20facilitate%20the%20macro%20to%20be%20made.%20Also%20if%20you%20just%20make%20an%20example%20for%20the%20first%20floor%2C%20we%20could%20copy%20it%20for%20the%20following%20floor%20just%20changing%20the%20area%20to%20be%20counted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20in%20advance%2C%20Juan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-290032%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-290032%22%20slang%3D%22en-US%22%3EHi%20juan%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20looked%20at%20your%20file%20and%20if%20you%20have%20used%20the%20built-in%20Excel%20shapes%20or%20at%20least%20your%20objects%20were%20drawings%20and%20not%20picture%2C%20then%20what%20you%20have%20asked%20was%20easy.%3CBR%20%2F%3E%3CBR%20%2F%3ENow%2C%20the%20complication%20starts%20when%20your%20objects%20are%20not%20drawing%2Fshapes%20but%20they%20are%20picture%20objects%20and%20hence%20we%20cannot%20identify%20them%20by%20object%20type%20based%20on%20how%20it%20looks.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20you%20are%20willing%20to%20work%20with%20non-picture%20objects%2C%20then%20I%20can%20write%20some%20function%20that%20can%20count%20based%20on%20each%20room%20next%20to%20the%20each%20icon.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-289994%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-289994%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20again%20on%20thank%20you%20very%20much%20for%20your%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20you%20come%20see%20we%20are%20trying%20to%20do%20some%20architectural%20work%20in%20an%20Excel%20sheet.%20We%20were%20supposed%20to%20be%20using%20AutoCAD%20but%20as%20we%20are%20full%20supporters%20of%20Excel%20we%20are%20trying%20to%20do%20it%20for%20the%20first%20time%20in%20this%20worksheet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20trying%20to%20measure%20in%20each%20floor%20how%20many%20items%20are%20we%20going%20to%20use%20so%20that%20it%20could%20be%20linked%20to%20another%20sheet%20were%20prices%20per%20item%20with%20give%20us%20the%20amount%20of%20material%20used.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20we%20tried%20to%20count%20the%20shapes%20it%20is%20a%20bit%20difficult%20for%20us%20to%20distinguish%20how%20many%20items%20per%20flat%20we%20do%20need.%20If%20you%20look%20into%20columns%20K%26amp%3BL%20%26nbsp%3Byou%20can%20have%20an%20idea%20of%20what%20we%20are%20trying%20to%20measure%20exactly.%20I%20wonder%20if%20you%20could%20help%20us%20to%20obtain%20in%20column%20M%20the%20number%20of%20items%20per%20floor.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20the%20best!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-289511%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-289511%22%20slang%3D%22en-US%22%3Ejuan%2C%3CBR%20%2F%3E%3CBR%20%2F%3Eyou%20are%20welcome.%20you%20can%20post%20your%20excel%20here%20if%20you%20want%20to.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-289135%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-289135%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Jamil%2C%3C%2FP%3E%3CP%3Eyour%20code%20was%20very%20useful.%20thank%20you%20very%20much.%3C%2FP%3E%3CP%3Ecould%20i%20ask%20for%20some%20more%20help%20regarding%20the%20project%20I%20am%20working%20with%3F%20can%20i%20send%20you%20the%20excel%20so%20that%20you%20can%20see%20the%20purpose%20of%20the%20code%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-288621%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-288621%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20use%20the%20code%20below%20and%20it%20will%20add%20new%20sheet%20and%20will%20list%20all%20of%20the%20shapes%20with%20their%20name%20and%20location%2C%20then%20you%20can%20pivot%20it%20to%20see%20how%20many%20of%20which%20you%20have.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CPRE%3ESub%20ListShapes()%0A%20%20%20%20Dim%20Wks%20As%20Worksheet%0A%20%20%20%20Dim%20shp%20As%20Shape%0A%20%20%20%20Dim%20nRow%20As%20Long%0A%20%20%20%20Sheets.Add%0A%20%20%20%20Cells.Clear%0A%20%20%20%20Cells(1%2C%201)%20%3D%20%22Worksheet%22%0A%20%20%20%20Cells(1%2C%202)%20%3D%20%22Shape%22%0A%20%20%20%20Cells(1%2C%203)%20%3D%20%22Type%22%0A%20%20%20%20Cells(1%2C%204)%20%3D%20%22OnAction%22%0A%20%20%20%20Cells(1%2C%205)%20%3D%20%22Hyperlink%22%0A%20%20%20%20Cells(1%2C%206)%20%3D%20%22TopLeft%22%0A%20%20%20%20Cells(1%2C%207)%20%3D%20%22BotRight%22%0A%20%20%20%20Cells(1%2C%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%3D%20%22Height%22%0A%20%20%20%20Cells(1%2C%209)%20%3D%20%22Width%22%0A%20%20%20%20Cells(1%2C%2010)%20%3D%20%22Autoshape%22%0A%20%20%20%20Cells(1%2C%2011)%20%3D%20%22Form%22%0A%20%20%20%20nRow%20%3D%201%0A%20%20%20%20On%20Error%20Resume%20Next%0A%20%20%20%20For%20Each%20Wks%20In%20ActiveWorkbook.Worksheets%0A%20%20%20%20%20%20%20%20For%20Each%20shp%20In%20Wks.Shapes%0A%20%20%20%20%20%20%20%20%20%20%20%20nRow%20%3D%20nRow%20%2B%201%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%201)%20%3D%20%22'%22%20%26amp%3B%20Wks.Name%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%202)%20%3D%20shp.Name%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%203)%20%3D%20shp.Type%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%204)%20%3D%20shp.OnAction%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%205)%20%3D%20shp.Hyperlink.Address%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%206)%20%3D%20shp.TopLeftCell.Address(0%2C%200)%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%207)%20%3D%20shp.BottomRightCell.Address(0%2C%200)%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%3D%20shp.Height%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%209)%20%3D%20shp.Width%0A%20%20%20%20%20%20%20%20%20%20%20%20Cells(nRow%2C%2010)%20%3D%20shp.AutoShapeType%0A%20%20%0A%20%20%20%20%20%20%20%20Next%20shp%0A%0A%20%20%20%20Next%20Wks%0Adone%3A%20nRow%20%3D%20nRow%20%2B%200%0AEnd%20Sub%0A%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-288605%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-288605%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20very%20much%20for%20your%20answers.%3C%2FP%3E%3CP%3EIn%20my%20case%20I%20am%20using%2010%20different%20shapes%20in%20a%20sheet%20that%20are%20repeated%20several%20times%20each%20one.%3C%2FP%3E%3CP%3EI%20would%20like%20to%20count%20at%20the%20end%20of%20the%20sheet%20how%20many%20of%20them%20I%20have%20you%20all%20over%20sheet.%3C%2FP%3E%3CP%3EHowever%2C%20please%20note%20that%20some%20are%20lines%20of%20different%20desing%2C%20different%20circles%20or%20rectangles%20or%20basic%20forms.%3C%2FP%3E%3CP%3ELooking%20forward%20to%20hearing%20from%20you.%20best%20regards%2C%20Juan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-287662%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287662%22%20slang%3D%22en-US%22%3E%3CP%3EShapes%20can%20be%20charts%2C%20callouts%2C%20diagrams%20many%20types%20of%20shapes%20exists.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eif%20you%20want%20to%20count%20particular%20one%20of%20them%20then%20you%20can%20use%20the%20code%20below%20and%20you%20can%20change%20the%20shp.type%26nbsp%3B%20on%20any%20of%20the%20below%20listed%26nbsp%3BShapeType%20Enumeration%20to%20count%20particular%20ones%20or%20exclude%20or%20include%20shape%20types.%26nbsp%3B%20if%20you%20remove%20the%20shape%20type%20then%20it%20will%20count%20anything%20that%20is%20classified%20as%20shapes%20in%20Excel%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ESub%20Test2()%0A%20%20%20%20Dim%20shp%20As%20Shape%0A%20%0A%20%20%20%20For%20Each%20shp%20In%20Sheet1.Shapes%0A%20%20%20%20%20%20%20%20If%20shp.Type%20%3D%201%20Then%0A%20%20%20%20%20%20%20%20Counter%20%3D%20shp.ID%20%2B%201%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20Next%0A%20%20%20%20MsgBox%20Counter%20-%202%0AEnd%20Sub%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22asdas.jpg%22%20style%3D%22width%3A%20581px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F59929i793101221AC75AAD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22asdas.jpg%22%20alt%3D%22asdas.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-287633%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287633%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20the%20only%20way%20to%20do%20that%20is%20by%20using%20a%20VBA%20code!%3C%2FP%3E%3CP%3ESo%2C%20please%20try%20the%20following%20code%20to%20get%20the%20count%20of%20all%20shapes%20in%20the%20active%20worksheet%20so%20that%20it's%20displayed%20in%20a%20message%20box.%3C%2FP%3E%3CPRE%3ESub%20GetShapesCount()%3CBR%20%2F%3E%20%20%20MsgBox%20ActiveSheet.Shapes.Count%3CBR%20%2F%3EEnd%20Sub%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20follow%20this%20%3CA%20href%3D%22https%3A%2F%2Fwww.ablebits.com%2Foffice-addins-blog%2F2013%2F12%2F06%2Fadd-run-vba-macro-excel%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Elink%3C%2FA%3E%20to%20learn%20how%20to%20insert%20and%20run%20this%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1612913%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1612913%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F24499%22%20target%3D%22_blank%22%3E%40Jamil%20Mohammad%3C%2FA%3E%26nbsp%3BHi%2C%20this%20is%20very%20useful%20for%20me.%20I'm%20wondering%20how%20do%20I%20list%20also%20the%20color%20of%20the%20different%20shapes%2C%20since%20I've%20color%20coded%20the%20same%20shapes%20based%20on%20color.%20Thanks%20in%20advanced%20for%20your%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1618631%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20Count%20how%20many%20shapes%20are%20on%20a%20sheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1618631%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F771561%22%20target%3D%22_blank%22%3E%40fuad360%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eto%20retrieve%20the%20color%2C%20you%20can%20use%20my%20original%20code%20by%20adding%26nbsp%3B%20Cells(nRow%2C%2012)%20%3D%20shp.Fill.BackColor%26nbsp%3B%20%26nbsp%3Bfor%20background%20color%26nbsp%3B%20and%26nbsp%3BCells(nRow%2C%2013)%20%3D%20shp.Fill.ForeColor%26nbsp%3B%20for%20front%20color%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello everyone, I need help with this issue, How do Count how many shapes are on a sheet? 

13 Replies

Hi,

 

I think the only way to do that is by using a VBA code!

So, please try the following code to get the count of all shapes in the active worksheet so that it's displayed in a message box.

Sub GetShapesCount()
MsgBox ActiveSheet.Shapes.Count
End Sub

 

Please follow this link to learn how to insert and run this code.

 

Hope that helps

Shapes can be charts, callouts, diagrams many types of shapes exists.

 

if you want to count particular one of them then you can use the code below and you can change the shp.type  on any of the below listed ShapeType Enumeration to count particular ones or exclude or include shape types.  if you remove the shape type then it will count anything that is classified as shapes in Excel

  

Sub Test2()
    Dim shp As Shape
 
    For Each shp In Sheet1.Shapes
        If shp.Type = 1 Then
        Counter = shp.ID + 1
        End If
    Next
    MsgBox Counter - 2
End Sub

 asdas.jpg

Thank you very much for your answers.

In my case I am using 10 different shapes in a sheet that are repeated several times each one.

I would like to count at the end of the sheet how many of them I have you all over sheet.

However, please note that some are lines of different desing, different circles or rectangles or basic forms.

Looking forward to hearing from you. best regards, Juan

You can use the code below and it will add new sheet and will list all of the shapes with their name and location, then you can pivot it to see how many of which you have.

Sub ListShapes()
    Dim Wks As Worksheet
    Dim shp As Shape
    Dim nRow As Long
    Sheets.Add
    Cells.Clear
    Cells(1, 1) = "Worksheet"
    Cells(1, 2) = "Shape"
    Cells(1, 3) = "Type"
    Cells(1, 4) = "OnAction"
    Cells(1, 5) = "Hyperlink"
    Cells(1, 6) = "TopLeft"
    Cells(1, 7) = "BotRight"
    Cells(1, 8) = "Height"
    Cells(1, 9) = "Width"
    Cells(1, 10) = "Autoshape"
    Cells(1, 11) = "Form"
    nRow = 1
    On Error Resume Next
    For Each Wks In ActiveWorkbook.Worksheets
        For Each shp In Wks.Shapes
            nRow = nRow + 1
            Cells(nRow, 1) = "'" & Wks.Name
            Cells(nRow, 2) = shp.Name
            Cells(nRow, 3) = shp.Type
            Cells(nRow, 4) = shp.OnAction
            Cells(nRow, 5) = shp.Hyperlink.Address
            Cells(nRow, 6) = shp.TopLeftCell.Address(0, 0)
            Cells(nRow, 7) = shp.BottomRightCell.Address(0, 0)
            Cells(nRow, 8) = shp.Height
            Cells(nRow, 9) = shp.Width
            Cells(nRow, 10) = shp.AutoShapeType
  
        Next shp

    Next Wks
done: nRow = nRow + 0
End Sub

Hi Jamil,

your code was very useful. thank you very much.

could i ask for some more help regarding the project I am working with? can i send you the excel so that you can see the purpose of the code?

juan,

you are welcome. you can post your excel here if you want to.

Hello again on thank you very much for your help.

 

As you come see we are trying to do some architectural work in an Excel sheet. We were supposed to be using AutoCAD but as we are full supporters of Excel we are trying to do it for the first time in this worksheet.

 

We are trying to measure in each floor how many items are we going to use so that it could be linked to another sheet were prices per item with give us the amount of material used.

 

When we tried to count the shapes it is a bit difficult for us to distinguish how many items per flat we do need. If you look into columns K&L  you can have an idea of what we are trying to measure exactly. I wonder if you could help us to obtain in column M the number of items per floor.

 

All the best!

Hi juan,

I looked at your file and if you have used the built-in Excel shapes or at least your objects were drawings and not picture, then what you have asked was easy.

Now, the complication starts when your objects are not drawing/shapes but they are picture objects and hence we cannot identify them by object type based on how it looks.

If you are willing to work with non-picture objects, then I can write some function that can count based on each room next to the each icon.

Dear friend,

 

I hope you are fine. we have reviewed the excel to assign shapes to all items we would like to count instead of mixing images and shapes. Even though some of them are still marked with an image. The image will serve to guide us from a visual point of view. However the shapes can give us an idea of how many items will have to count.

 

It would be fantastic if we could make a macro that counts the items per floor. We have tried to do the  plans separated so that the surface could be the limited for each floor.

 

In columns K and L you have the shapes that we would like to count.  

 

Please feel free to send us any suggestion that could facilitate the macro to be made. Also if you just make an example for the first floor, we could copy it for the following floor just changing the area to be counted.

 

Thank you very much in advance, Juan

Hi,

I can see that you are only using images. not the original Excel built-in shapes.
However, it is possible to count the specific images, but they need to be named properly.

 

for example these two images have the same name Gráfico 373 & Gráfico 375  if you want them to be counted seperately then you need to name each type differently, regardless of it is number, but the Gráfico to be replaced with something else. similarly for other image objects as well. each of them should have a unique name

dg.jpgas.jpg

 

 

for example this one bulb 1 and bulb 2 for the second image like this and then bulb 3 for third and so on.  so the bulb name should only be used for this image.

as.jpg

Dear Jamil,

Thank you again for your answer and help.

We thought we were using also original shapes.

 

1) How could we assign a shape name to each different one?

2) Which are the "original Excel built-in shapes"?

 

Tx, Juan

 

@Jamil Mohammad Hi, this is very useful for me. I'm wondering how do I list also the color of the different shapes, since I've color coded the same shapes based on color. Thanks in advanced for your help.

@fuad360 

 

Hi,  

 

to retrieve the color, you can use my original code by adding  Cells(nRow, 12) = shp.Fill.BackColor   for background color  and Cells(nRow, 13) = shp.Fill.ForeColor  for front color