![]() |
||
---|---|---|
PowerPoint tips, hints and tutorials that will change your presentations for ever! | ||
IF you have Digg or Del.icio.us accounts save us here. Jigsaws |
Some vba Samples If you haven't already read How to Use vba Code you should do this first. Last Slide Viewed + 1 This code snippet is for use in Slide show mode ONLY. Copy and paste it to a module see How to use vba Code and then give an action button an action of Run > Macro > lastplus
The action button you make will return you to the slide AFTER the last slide viewed. Note that the on error statement is used because in the unlikly case of an error it sends the user to a "safe" message rather that the default possibility of debug the code. You do not want users playing with the code! The code will normally end at "exit sub" and never get to the message. Change My Colour This code will change the colour of any shape clicked in slide show mode. This is a good place to start adapting code. Adjust the R, G and B values (currently 255,0,0) to get the colour you want.
Any shape that you want to click should be given an action setting of Run > Macro>changecol Change Font for Whole Presentation This vba will save your life when someone produces a presentation with different font styles and colours on every page and because they don't follow the Master you have to change each one individually. This vba will do the job in a tick!. You will need to change the values for font name, size and RGB values for title and body text and maybe set .bold and / or .italic to msotrue. Note only text in Placeholders is converted. Sub allchange() UnBold This code searches placeholders and textboxes in the presentation for BOLD text and un-bolds it Sub unbold()
Jump to a Random Slide This is the code to jump to a random slide within a given range. Give an action button an action of Run > Macro > randjump to use it. To generate the random number use this formula: Number =Int((highest number in range - one less that lowest number)*rnd + lowest number in range) eg For a number between 4 and 10 number = Int(10-3)*rnd+4) ---OR -- Int(7*rnd +4) So here's the code to jump to a random slide between 4 and 10 Sub randjump() Most people will tell you random slide choice can only be done with vba. If vba isn't suitable for your use look at random powerpoint slides without vba See more vba samples here Table Format Copy and Selective Printing
|
|
Articles on your favourite sport Free Microsoft PowerPoint Advice, help and tutorials, Template Links |