Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2012, 07:46 AM
Jamtart Jamtart is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 64bit
Advanced Beginner
Should be a simple macro, need a start
 
Join Date: Apr 2012
Posts: 53
Jamtart is on a distinguished road
Default 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...
Reply With Quote
  #2  
Old 08-12-2012, 02:00 PM
Jamtart Jamtart is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 64bit
Advanced Beginner
Should be a simple macro, need a start
 
Join Date: Apr 2012
Posts: 53
Jamtart is on a distinguished road
Default

I am such a newbie at this that I got powerpoint crashing every time I think I got something.
Reply With Quote
  #3  
Old 08-12-2012, 06:00 PM
Venky62 Venky62 is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 32bit
Advanced Beginner
 
Join Date: Jul 2012
Posts: 58
Venky62 is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 08-12-2012, 06:51 PM
Jamtart Jamtart is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 64bit
Advanced Beginner
Should be a simple macro, need a start
 
Join Date: Apr 2012
Posts: 53
Jamtart is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 08-12-2012, 10:48 PM
Venky62 Venky62 is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 32bit
Advanced Beginner
 
Join Date: Jul 2012
Posts: 58
Venky62 is on a distinguished road
Default

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.
Attached Files
File Type: zip SAMPLE.zip (87.2 KB, 9 views)

Last edited by Venky62; 08-12-2012 at 11:05 PM. Reason: Change attachment
Reply With Quote
  #6  
Old 08-13-2012, 01:34 AM
JohnWilson JohnWilson is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

See if this does it
Attached Files
File Type: zip SAMPLEJohn.zip (52.2 KB, 16 views)
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #7  
Old 08-13-2012, 02:30 AM
Venky62 Venky62 is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 32bit
Advanced Beginner
 
Join Date: Jul 2012
Posts: 58
Venky62 is on a distinguished road
Default

John's code is much simpler and precise. First time I saw how to prevent entry of a non-numeric character. Thanks.
Reply With Quote
  #8  
Old 08-13-2012, 06:11 AM
Jamtart Jamtart is offline Should be a simple macro, need a start Windows 7 64bit Should be a simple macro, need a start Office 2010 64bit
Advanced Beginner
Should be a simple macro, need a start
 
Join Date: Apr 2012
Posts: 53
Jamtart is on a distinguished road
Default

This is great, it will give my next project the jump start it needed.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Should be a simple macro, need a start 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft