VBA问题(PowerPoint) [英] VBA Question (PowerPoint)

查看:75
本文介绍了VBA问题(PowerPoint)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些代码允许我将两位数字发送到PowerPoint幻灯片上的形状。 (见下文。) 数字"11"不起作用可能因为两个数字是相同的。  帮助!



Sub TextBox1_Change()



如果Len(我) .TextBox1.Text)= 2然后

选择案例UCase(Me.TextBox1.Text)

案例"01","02","03", "04","05","06","07","08","09","10","11","12"和"b" $ b strIn = UCase(Me.TextBox1.Text)

设置osld = ActivePresentation.SlideShowWindow.View.Slide

strResult = osld.Shapes(" Results")。 TextFrame.TextRange.Text

如果是InStr(strResult,strIn)> 0然后

'存在

否则

如果strResult<> ""然后是
osld.Shapes(" Results")。TextFrame.TextRange = strResult& vbCrLf& strIn

否则

osld.Shapes(" Results")。TextFrame.TextRange = strIn

结束如果

结束如果

案例等等

'没有任何货币b $ b结束选择

Me.TextBox1.Text ="" ;
$
结束如果

结束次级





 

解决方案


我有一些代码允许我将两位数字发送到PowerPoint幻灯片上的形状。 (见下文。)


这里应该询问与VBA有关的问题:


< p style ="line-height:15.75pt; vertical-align:baseline"> Visual Basic for Applications 
(VBA)


当您在那里发布查询时,请确保"是否工作"是否清楚意味着选择是没有被触发,或被触发,但结果不是你所期望的。


I have some code that allows me to send two digit numbers to a shape on a PowerPoint slide. (See below.)  The number "11" does not work probably because both digits are the same.  Help!

Sub TextBox1_Change()

If Len(Me.TextBox1.Text) = 2 Then
Select Case UCase(Me.TextBox1.Text)
Case "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"
strIn = UCase(Me.TextBox1.Text)
Set osld = ActivePresentation.SlideShowWindow.View.Slide
strResult = osld.Shapes("Results").TextFrame.TextRange.Text
If InStr(strResult, strIn) > 0 Then
'exists
Else
If strResult <> "" Then
osld.Shapes("Results").TextFrame.TextRange = strResult & vbCrLf & strIn
Else
osld.Shapes("Results").TextFrame.TextRange = strIn
End If
End If
Case Else
'nothing
End Select
Me.TextBox1.Text = ""
End If
End Sub


 

解决方案

I have some code that allows me to send two digit numbers to a shape on a PowerPoint slide. (See below.)

Questions relating to VBA should be asked here:

Visual Basic for Applications  (VBA)

When you post your query there, make sure that it is clear whether 'does not work' means that the Select is not being triggered, or that it is being triggered, but the result is not what you expected.


这篇关于VBA问题(PowerPoint)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆