VBA中的一些代码

让OFFICE能识别文档中的文字如果要让此程序能运行,要添加EXCEL的引用,只有EXCEL才有此功能Sub SpeakIt() Set x = New Excel.Application x.Speech.Speak (ActiveWindow.Selection) Set x = NothingEnd Sub

让PPT能随机出题。Slides 一个代表指定演示文稿中所有幻灯片的 Slides 集合。只读。

Sub RandomlyPlay() Dim num As Integer Randomize Dim i As Integer n = ActivePresentation.Slides.Count – 1 i = Int(n * Rnd + 1) ‘ MsgBox i ActiveWindow.View.GotoSlide i End Sub

‘Sub InsertTitle() Range(“A1”).Select ActiveCell.EntireRow.Select Selection.Copy ActiveCell.Offset(2, 0).Range(“A1”).EntireRow.Select Do While Not ActiveCell.Text = “” Selection.Insert Shift:=xlDown ActiveCell.EntireRow.Select Selection.Copy ActiveCell.Offset(2, 0).Range(“A1”).EntireRow.Select

Loop Application.CutCopyMode = False ‘2?′|óú???D?ò?′???£ê?End Sub

要克服生活的焦虑和沮丧,得先学会做自己的主人

VBA中的一些代码

相关文章:

你感兴趣的文章:

标签云: