How to find number of chart's in one worksheet

asramasarma

New Member
Joined
May 1, 2002
Messages
10
I have to find all the Chart's that are present in the excel sheet .
Please help me.
This message was edited by asramasarma on 2002-05-03 05:04
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
There is probably a better way, but this was my solution:

Sub ChrsCount()
'Find last cell on sheet
Selection.SpecialCells(xlCellTypeLastCell).Select
lastcol = Selection.Column
lastrow = Selection.Row
Range("A1").Select

'Count characters in each cell
For x = 1 To lastcol
For y = 1 To lastrow
cellcount = Len(Cells(y, x).Value)
mytotal = mytotal + cellcount
Next y
Next x
MsgBox ("Total Characters = " & mytotal)

End Sub

Phil.
 
Upvote 0
a quick way without the macro is to select the whole sheet containing the data and copy and paste in MS word. Then use the word count which also give the number od characters
 
Upvote 0
Sorry, Is that a joke, or is there really something called cahrts? Am I being really slow?
 
Upvote 0
OK, Charts. Thats much easier. One line of VB should do it:

myCount = ActiveSheet.ChartObjects.Count

You realise that changing your original entry makes my original answer look very bizarre!
 
Upvote 0
The following will do it for the whole workbook (you could also make this a function, I suppose): -

Public Sub NoOfCharts()

Dim ch As ChartObject
Dim ws As Worksheet
Dim x As Integer
Dim y As Integer

y = ThisWorkbook.Charts.Count

For Each ws In Worksheets
For Each ch In ws.ChartObjects
x = x + 1
Next ch
Next ws

MsgBox x & " embedded charts." & vbCrLf & y & " chart sheets."

End Sub
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,240
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top