Microsoft PowerPoint是我们都喜欢使用的强大工具。就交付演示而言,没有其他程序可以如此完整。现在,我们中的一些人希望能够为演示文稿创建一个进度条。现在的问题是,这可能吗?
如何在PowerPoint中创建和使用(PowerPoint)进度条(Progress Bar)
这个问题的答案是肯定的。任何拥有正确信息的人都可以轻松创建进度条,你猜怎么着?我们将详细介绍如何完成它。
现在,可以通过在每张幻灯片下方安装相关形状来手动安装进度条。然而,这带来了额外的问题。您会看到,用户必须根据演示文稿中的幻灯片数量来测量每个形状的长度。
此外,每当删除幻灯片时,您将需要为所有其他幻灯片重新创建进度条。我们不会为做那样的事情而烦恼;因此,我们决定走宏观(Macro)路线。就是这样!
- 打开您喜欢的PowerPoint演示文稿
- 选择宏并注入名称
- 在Microsoft Visual Basic(Microsoft Visual Basic) for Applications ( VBA ) 窗口中粘贴代码
- 关闭并运行宏
让我们从更详细的角度来看这个问题。
1]打开(Open)您喜欢的PowerPoint演示文稿
好的,所以您必须在这里做的第一件事是打开您要使用的PowerPoint演示文稿。(PowerPoint)如果没有,您可以从头开始创建一个,然后逐步进行。
2]选择宏并注入名称
打开演示文档后,您现在必须继续并单击View,然后确保选择右侧的Macros。单击按钮后,应立即出现一个小窗口。
然后,下一步是键入Macro Name。我们选择添加SlideBar,但您可以自由添加最适合的名称。完成后,点击创建按钮以完成此部分。
3]在Microsoft Visual Basic for Applications ( VBA ) 窗口中粘贴(Paste)代码
好的,所以在点击创建(Create)按钮后,将出现一个新窗口。这个窗口被称为Microsoft Visual Basic for Applications ( VBA ),它就是魔法发生的地方。
在编辑器中,您应该看到以下内容:
Sub ProgressBar()
End Sub
(Click)在代码的两行之间单击,并确保立即复制并粘贴以下内容:
On Error Resume Next
With ActivePresentation
For X = 1 To .Slides.Count
.Slides(X).Shapes("PB").Delete
Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
0, .PageSetup.SlideHeight - 12, _
X * .PageSetup.SlideWidth / .Slides.Count, 12)
s.Fill.ForeColor.RGB = RGB(127, 0, 0)
s.Name = "PB"
Next X:
End With
4]关闭并运行宏
完成上述任务后,您现在必须立即关闭VBA窗口。
完成后,单击PowerPoint中的(PowerPoint)View选项卡,然后选择Macros。
选择Macro的名称,然后选择Run完成,就是这样。
现在阅读(Now read):如何在 Excel、PowerPoint 和 Word 中创建漏斗图。
How to create and use Progress Bar in PowerPoint
Microsoft PowerPoint is a powerful tool that we all like to use. There is no other program that is as complete when it comes down to delivering presentations. Now, some of us would love to be able to create a progress bar for presentations. The question is, right now, is it possible?
How to create and use Progress Bar in PowerPoint
The answer to that question is a resounding yes. Anyone with the right information can easily create a progress bar, and guess what? We’re going to detail how to get it done.
Now, it is possible to manually install a progress bar by installing the relevant shape below each slide. However, that brings additional problems to the table. You see, users must measure the length of every shape that is based on the number of slides in the presentation document.
Also, whenever a slide is removed, you will then be required to recreate the progress bar for all other slides. We can’t be bothered with doing things like that; therefore, we’ve decided to go the Macro route. Here’s how!
- Open your preferred PowerPoint presentation
- Select Macros and inject a name
- Paste code in Microsoft Visual Basic for Applications (VBA) window
- Close and run Macro
Let us look at this more from a detailed perspective.
1] Open your preferred PowerPoint presentation
OK, so the first thing you must do here is to open the PowerPoint presentation you want to work with. If not, you can create one from scratch and then work your way up.
2] Select Macros and inject a name
Once you’ve opened your presentation document, you must now go on ahead and click on View, and from there, be sure to select Macros located at the right. A small window should appear right away after you’ve clicked on the button.
The next step, then, is to type a Macro Name. We’ve chosen to add SlideBar, but you are free to include whatever name that is best suited. Once that is done, hit the create button to complete this section.
3] Paste code in Microsoft Visual Basic for Applications (VBA) window
OK, so after hitting the Create button, a new window will appear. This window is called Microsoft Visual Basic for Applications (VBA), and it is where the magic happens.
From within the editor, you should see the following:
Sub ProgressBar()
End Sub
Click between the two lines of the code, and be sure to copy and paste the following right away:
On Error Resume Next
With ActivePresentation
For X = 1 To .Slides.Count
.Slides(X).Shapes("PB").Delete
Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
0, .PageSetup.SlideHeight - 12, _
X * .PageSetup.SlideWidth / .Slides.Count, 12)
s.Fill.ForeColor.RGB = RGB(127, 0, 0)
s.Name = "PB"
Next X:
End With
4] Close and run Macro
After you’ve completed the above task, you must now close the VBA window right away.
Once that is done, click on the View tab from within PowerPoint, then select Macros.
Choose the name of the Macro, and finish off by selecting Run, and that’s it.
Now read: How to create a Funnel Chart in Excel, PowerPoint and Word.