#1
|
|||
|
|||
Should be a simple macro, need a start
Seems the more I think I learn the more confused I gets. So lets start simple, I want to insert 3 textboxes (Active X Control), TextBox1, TextBox2 and TextBox3. I simply want to have: TextBox1 + TextBox2 = TextBox3. Been working on other projects and gotten some awesome assistance in my learning process, now I see another tool (above) that can be learned to create more powerpoints for my classroom... |
#2
|
|||
|
|||
I am such a newbie at this that I got powerpoint crashing every time I think I got something.
|
#3
|
|||
|
|||
I am assuming that you know how to insert code in the code window and use it. Create three text boxes on your slide by going to Insert>Text Box. Do not use the Text Box in the Active X Control tool box (this is located on the Developer Tab of the ribbon).Then enter this code in a new module or the code window for the slide:
Sub test() ActivePresentation.Slides(1).Shapes(3).TextFrame.T extRange.Text = _ CInt(ActivePresentation.Slides(1).Shapes(1).TextFr ame.TextRange.Text) _ + CInt(ActivePresentation.Slides(1).Shapes(2).TextFr ame.TextRange.Text) End Sub This assumes that you are running the code on Slide 1 of your slideshow. If not, change the slides(1) to whichever slide number you want the code to run on. If you don't know how to insert code in the VB Editor then look at this link http://www.gmayor.com/installing_macro.htm |
#4
|
|||
|
|||
Following this to the letter and it will not work for me. This is very different from what I thought it was going to be. Thought for sure the way to go was with the Text Box in the Active X Control tool box.
|
#5
|
|||
|
|||
As it may be difficult to explain how to use the code, I am sending a sample ppt file with two slides. On one slide I have used Text Boxes which are part of shapes (you insert them by Insert>Text Box menu), and on the second one I have use Active X Text Boxes (from the Developer Tab tool box).
As you can see, both have advantages and disadvantages. But once you write proper code, Active X Text boxes are more user friendly. To view code, press Alt+F11, and select the appropriate slide from the Project Explorer window. To see the code work, view the slides in slide show mode or the Reading View mode. Last edited by Venky62; 08-12-2012 at 11:05 PM. Reason: Change attachment |
#6
|
|||
|
|||
See if this does it
|
#7
|
|||
|
|||
John's code is much simpler and precise. First time I saw how to prevent entry of a non-numeric character. Thanks.
|
#8
|
|||
|
|||
This is great, it will give my next project the jump start it needed.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Another simple macro problem | Ulodesk | Word VBA | 1 | 06-08-2012 06:24 PM |
Simple VBA macro error | Formulayeti | PowerPoint | 1 | 12-09-2011 10:02 PM |
Simple or what? | nebb | Publisher | 0 | 09-23-2010 07:00 AM |
automatic start of macro + help on writing helper function | vsempoux | Word | 3 | 10-09-2009 03:01 AM |
Simple macro undoable? | garon5 | Outlook | 0 | 04-20-2007 10:27 AM |