VBA - How to count masters in v2003?

I thought it'd be easy, but I can't find an object to get a count off
of or to loop for a count. I'm just trying to count the masters in the
active presentation. (Every TitleMaster + every SlideMaster) I need
the count of all the actual masters as seen in the masters view.

Thanks,
Melina
0
Mel
11/29/2009 9:04:33 PM
powerpoint 2011 articles. 0 followers. Follow

2 Replies
840 Views

Similar Articles

[PageSpeed] 15

In article <70aaf226-7f3a-44c7-b63e-
550591be37a3@e27g2000yqd.googlegroups.com>, Mel wrote:
> I thought it'd be easy, but I can't find an object to get a count off
> of or to loop for a count. I'm just trying to count the masters in the
> active presentation. (Every TitleMaster + every SlideMaster) I need
> the count of all the actual masters as seen in the masters view.

Sub JectItToTests()

    Dim x As Long
    
    With ActivePresentation

        ' What we humans call "Masters", PPT thinks of as
        ' "Designs"
        MsgBox .Designs.Count
        
        ' Each design will always have a slide master
        ' but may or may not have a title master
        For x = 1 To .Designs.Count
            If .Designs(x).HasTitleMaster Then
                MsgBox "Design " & CStr(x) & " has a Title master"
            End If
        Next
        
    End With
    
End Sub


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


0
Steve
11/30/2009 2:26:20 AM
Once more, you're my hero! <g>

Here's what I made to count them all together...

Sub CountTheMasters()
    Dim x As Long
    Dim iMasterCount As Long
    With ActivePresentation
        For x =3D 1 To .Designs.Count
            iMasterCount =3D iMasterCount + 1
            If .Designs(x).HasTitleMaster Then
                iMasterCount =3D iMasterCount + 1
            End If
        Next
    End With
    MsgBox "This presentation has " & iMasterCount & " masters."
End Sub

Thanks Steve.
-Melina

On Nov 29, 8:26=A0pm, Steve Rindsberg <ab...@localhost.com> wrote:
> In article <70aaf226-7f3a-44c7-b63e-
>
> 550591be3...@e27g2000yqd.googlegroups.com>, Mel wrote:
> > I thought it'd be easy, but I can't find an object to get a count off
> > of or to loop for a count. I'm just trying to count the masters in the
> > active presentation. (Every TitleMaster + every SlideMaster) I need
> > the count of all the actual masters as seen in the masters view.
>
> Sub JectItToTests()
>
> =A0 =A0 Dim x As Long
>
> =A0 =A0 With ActivePresentation
>
> =A0 =A0 =A0 =A0 ' What we humans call "Masters", PPT thinks of as
> =A0 =A0 =A0 =A0 ' "Designs"
> =A0 =A0 =A0 =A0 MsgBox .Designs.Count
>
> =A0 =A0 =A0 =A0 ' Each design will always have a slide master
> =A0 =A0 =A0 =A0 ' but may or may not have a title master
> =A0 =A0 =A0 =A0 For x =3D 1 To .Designs.Count
> =A0 =A0 =A0 =A0 =A0 =A0 If .Designs(x).HasTitleMaster Then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MsgBox "Design " & CStr(x) & " has a Titl=
e master"
> =A0 =A0 =A0 =A0 =A0 =A0 End If
> =A0 =A0 =A0 =A0 Next
>
> =A0 =A0 End With
>
> End Sub
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
> PPT Frequently Asked Questionshttp://www.pptfaq.com/
>
> PPTools add-ins for PowerPointhttp://www.pptools.com/

0
Mel
11/30/2009 3:48:07 AM
Reply:

Similar Artilces:

How to incorporate page counts in TOC
I need to find out how to incorporate each document’s total page count into the Table of Contents instead of the current page number. In my case, we have 20-60 separate document files that need a single TOC that states the total number of pages for each file. Example: Section No. of Pages 100 3 200 2 300 10 I forgot to mention, I am using MS Word 2007 "Krystal" wrote: > I need to find out how to incorporate each document’s total page count into > the Table of Contents instead of the current page number. > > In my case, we have 20-60 s...

Total daily e-mail count?
This might seem like an odd question, but my CIO is asking for a total e-mail count for messages both sent and/or received by our organization on any given day. I'm currently using Exchange Server 2003. Can this information be found within System Manager, or will a third party utility be needed to accumulate such information? Thanks. Perfmon will give you some basic metrics. Otherwise have a look at MessageStats from http://quest.com/messagestats. Fully-functional 30-day eval on the site. -- David Sengupta M.T.S., B.Sc., MVP, MCSE, MCSE 2000, CCA Ottawa, Canada Exchange Rep...

Creating bookmarks via VBA
Dear experts: I wonder whether the following is possible I got five text entries, each in its own paragraph text1 text2 text3 text4 text5 With all 5 paragraphs selected is it possible to create 5 five bookmarks automatically via VBA with the following names: text1 (bookmark name: product_de) text2 (bookmark name: product_en) text3 (bookmark name: product_es) text4 (bookmark name: product_fr) text5 (bookmark name: product_it) I hope this is feasible and not beyond the scope of this forum. Help is much appreciated. Thank you very much in advance. Regards, Andrea...

Excel 2003 - VBA
I need someone to give me a few buzz words and point me to some reference work so that I can get started. I want to place several buttons on a worksheet that will help the user move around. I need to create a button then upon activation change the Caption and execute a macro that will create a button on another sheet. upon activation of this button, I will execute a macro and at the end of the macro, delete the button. In order to work with the button I need to name it then address it to make the changes and ultimately delete it. Here is the code I used to create the first button: Active...

In Series and Master Posting give users ability to exclude recurr.
On the Series and Master Posting windows, please give users a checkbox to exclude recurring batches when they choose to select all. That would help prevent recurring batches from being posted when they should not be, and eliminate the requirement for users to manually deselect them if they select all. Thanks. ...

Count records b/w time range
I have a sheet which has data with date & time fields like this 19/10/2005 10:10 19/10/2005 11:30 19/10/2005 12:12 19/10/2005 12:15 19/10/2005 10:12 How do I make a formula to pull out count between each half hour slot? like: 10:00 - 10:30 =2 10:30 - 11:00 =0 11:00 - 11:30 =1 11:30 - 12:00 =0 12:00 - 12:30 =2 Please help. Cheers! Sunny =sumproduct(--(B1:B100>--"10:00:00"),--(B1:B100<=--"10:30:00")) -- HTH RP (remove nothere from the email address if mailing direct) <sunilkeswani@gmail.com> wrote in message news:1131569006.191782.216510@g44g200...

VBA coding to retrieve data from Access to Excel :S
Hey everyone, This is what i have so far. I have an excel workbook with 3 worksheets, SETUP, DATA and DISPLAY. I have been using a pre-coded program to bring data from a database where the program using the SETUP sheet from the excel workbook as its critaria and then populates the DATA sheet. I then can use the DATA sheet to display data in the DISPLAY sheet in which ever way i want. Complication is that this pre-coded program is limited to the amount of tables it can hit at a time. Basically its programmed to read up to 3 tables. I now need data from 5 tables all together. The first t...

Edit VBA
'Hi 'Below is a code given to me by one of the many good people around here replaced with "=" instead of "<>". 'Question is that I only need to be notified ONCE that cell B72 and B73 are equal (not when both are blank or zero ) 'because right now my worksheet keeps chiming anytime I input any value anywhere even when both mentioned cells are both blank. Private Declare Function sndPlaySound32 Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Private Sub Worksheet_C...

VBA Macro change column contents
I have a column in a worksheet which has a list of 3 digit numbers. I want to change the 3 digits to become 4 digits, the new fourth digit has to be a leading zero, i.e 355 to become 0355. I prefer the format of the digits to be a number but a text format would not be a problem. The length of the digits in the column are not static. i.e one month there may be 200 rows of data the next might be 300 and I would want the macro to cater for this variation. Thanks -- James James, A macro simply isn't necessary, select the column and apply a custom format of 0000 that...

Counting days
Have the following fields in a table: Date,Name,JobNo,Hours. I need a SQL query to count the number of days each Name appears over a period of days. Any Name can appear more than once on any Date. If a Name appeared three times on the same Date it should only count as one day. Any suggestions or help would be appreciated Thanks Phil_mac SELECT name, COUNT(*) FROM (SELECT DISTINCT name, [date] FROM tableName WHERE [date] BETWEEN firstDate AND lastDate) AS a GROUP BY name where firstDate and lastDate are parameters defining the range of date of your interest. ...

Using Access VBA to Format Conditionally in Excel
Here's a problem I have been stuck on for the last three months. I have a lot of VBA code in an access module that creates queries and tables. At the end of the code, I transfer all this information to an excel spreadsheet using the transfer spreadsheet option. I then have a batch of code which opens the spreadsheet, formats it, saves it and closes it. It works like a dream. However, the code is currently telling the excel spreadsheet to select collumns K and L and turn the whole columns pink. What I actually want is the code to search through columns K and L and turn an individual c...

Counting Number of Identical Entries in a Spreadsheet Column
I am using XP Home and Office XP. I use a spreadsheet that has about a hundred or so lines and a number of columns, one of which is "Agent Number" in which a four digit number is entered to identify the Agent for that particular line item. Is there an easy way for me to create a table showing a ranked order of the number of times each Agent is listed in the column (e.g., Agent 7818: 20, Agent 7820: 17, etc.)? Thanks in advance! -- Fred 2002 Hi use a pivot table for this . See: http://www.cpearson.com/excel/pivots.htm http://peltiertech.com/Excel/Pivots/pivotstart.htm http://www.c...

Display count of characters in a cell while typing.
Not sure if this should be here or in the worksheet.functions newsgroup but I think here is a safe spot. As a user types text into a cell I would like to have another cell display the number of characters that are currently in it. The count has to be 'live', meaning that as the person is typing the counter is updating, not simply updating after the user has pressed 'Enter'. Alternately, a count-down counter would be even nicer ;-) Suggestions? Search brought up nothing. -- Toby Erkson Oregon, USA Excel 2002 in Windows XP Hi not really possible as macros don&#...

VBA Training
Are there any good books out there that would assist someone who wants to learn VBA from the ground up? Something that would take a person from a beginner to mid-level or beyond? Just wondering what others have done to become proficient. Rick Hi Rick, I bought a book for Excel 2000 that is loaded with all kinds of useful stuff. The book is called Excel 2000 Power Programming with VBA, by John Walkenbach. It includes a CD. Over 800 pages, a big book. Donna "Rick" wrote: > Are there any good books out there that would assist someone who wants to > learn VBA from the ...

PivotTable count unique
I have several pivot tables linked to a single database with 12 fields All database records are unique One pivot table looks at just 2 fields from 12 as per the simplified example below: Field1 Field2 A abc A abc A def B ghi C hij Would like the pivot table to count the unique occurences from Field2 against Field1 The result would be: A 2 B 1 C 1 Any idea how this could be achieved within a pivot table? Ok, not sure if ur using 2007 or pre-2007, but look at subtotals. I have this in 2007: Field1 Field2 A abc ...

VBA to adjust Row Height
I am new to writing VBA and I am having trouble writing code that achieves the following: If text in D2>115 characters then adjust row D's height to 30, else row height remains 20 followed by the same if then statment for rows E thru M (i.e., If M2>115 Then Row M height = 30 Any suggestions would be greatly appreciated. Hi Bob you are tlaking about columns but you want to change the row height? I asume you're talking about row 2 (in your example?). Note you can't change the heigth of a row individually per column. If you change it it will apply for all columns. So maybe ...

Fill Color on master not the same as shape it was created from
Created some simple telephone pad shapes, that look like the letters and numbers on a telephone. But when I drag the shape onto the drawing, the black background color is blue. Changing the fill color works, but shouldn’t the master shape fill color be the same color as the shape when the master is created? You may have a shape that has a Fill style to define the fill color. It is possible that the Fill style in the stencil is different from the Fill style on the drawing page. You can select your shape and go to Format > Style to check this. -- Mark Nelson Office Graphics - V...

Trouble With Conditional Counting
Here's my example data: Date State Person Car Truck Bike Boat Mon FLA John Y Y Y Mon TEX Mary Y Tue FLA John Y Y Tue FLA Pete Y Wed CA John Y Y Thu FLA John Y Y Fri FLA Mary Y Fri FLA John Y Y What I want to is calculate how many vehicle...

Cannot access macros, security settings or VBA editor in OL 2003
Hello all, I've run into a problem on 3 separate machines (of 75) where the user cannot access the macros, security settings or VBA editor in Outlook 2003. The menu items are there but clicking them has no effect. Researching this on the net there are various options. I've tried the detect and repair office and fully uninstalling and reinstalling Office to no avail. If I delete the user profile from the machine, and recreate it, it starts working again. All the machines in the office are built from an image and Office is installed via a GPO, so I'm pretty sure that the ...

How to learn VBA
I live in San Francisco Bay Area. Anyone can help me with suggestion of where I could learn (classes?) VBA for Excel? I know very little mainly by playing around and reading some books but I think I need a more structured, fundamental approch to learning VBA. And frankly, haven't seen any structure in place to teach people, it maybe my impression, but its almost like, play and learn as you go kind of thing... Regards, Thrava I would suggest getting John Walkenbach's book... Excel 200x Power Programming With VBA (x means get his latest book) Check out his web site. The belo...

VBA online classes
Hi All, Can you all please help me find a very effective VBA online classes? i don't consider myself to be literate in this field at all. Thanking in advance. Glad. Good Morning, I’m not sure about classes (other than community colleges that offer expensive short courses), but there are plenty of online sites that offer free code and also some really great books available for sale at your local bookstore. One of my favorite books that I’ve use more often than anything else is called “Excel 2007 – Power Programming with VBA”. This book is written by John Walkenbach and...

'Large' or 'Max' in VBA
Is there a VBA equivalent to the Excel Functions Large/Small and Max/Min? -- Bill @ UAMS worksheetfunction.max(range("A1:A3")) -- HTH RP "BillCPA" <Bill @ UAMS> wrote in message news:E20257A7-C619-4F80-83FD-A8B390C8E877@microsoft.com... > Is there a VBA equivalent to the Excel Functions Large/Small and Max/Min? > > -- > Bill @ UAMS Thank you very much! "Bob Phillips" wrote: > worksheetfunction.max(range("A1:A3")) > > -- > > HTH > > RP > > "BillCPA" <Bill @ UAMS> wrote in mes...

Calling Excel shortcuts from VBA
Hi, I am trying to automate the following two excel shortcuts using VBA. I know I can use commandbar and commandcontrol to call excel menus but I can not find the submenus these shortcuts belong to. 1. Ctrl + [ -- cursor goes to the precedent cell 2. F5 + Enter -- cursor goes to the original cell Also, is it possible to call an excel shortcut from VBA? I know that one can call a worksheet function from VBA (For example, Application.WorksheetFunction.Fact(5) ). But is there way to call a shortcut, say Ctrl + C from VBA? Thanks, MG. Submitted via EggHeadCafe - So...

How to count an age group
Sorry, I am trying to do this operation: in cell F7 I have the following datas corresponding to peoples age how can I count the numbers of time its ocurrs eg. of 50-<70 50-<70 50-<70 17 <30 30-<50 70+ 17 <30 I also need to know the percentage of each of them, how often they have been in that cell. I appreciate if any good soul can help me. Cheers -- just arrived! Hazarding a guess that a pivot table is quite ideal for what you seek to do. It's easy n fast to set-up Here's the play to tinker with (steps in xl2003): Presume that you have age data (as posted) i...

Cannot open VBA Editor
I'm running GP8, and cannot figure out what needs to be done/installed to be able to open the VBA Editor under the Tools > Customizations menu. The option is "grayed out" even as SA. The Visual Basic for Applications Component from GP Setup is installed. Could someone please fill me in on what I am missing? Thank you. does your registration keys show that you are registered for it? Mike "Nicholas Hastings" <NicholasHastings@discussions.microsoft.com> wrote in message news:700C2AD6-F868-472B-B6D5-181D02C2E706@microsoft.com... > I'm running GP8, and...