Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1514|回复: 0

TextBox 的change 事件在第二个userform 不起作用

[复制链接]
发表于 2015-6-9 10:04 | 显示全部楼层 |阅读模式
请教各位高手:

我有两个userform, 每个userform上有一个textbox。当textbox输入的最后一个字符为“E"的时候,关闭本窗口,开另一个userform.

第一个userform 的textbox change事件:
Private Sub TextBox1_Change()
If (Right(UserForm1.TextBox1, 1) = "E") Then
Unload Me
Load UserForm2
UserForm2.Show
End If
End Sub
第二个userform 的textbox 类似:
Private Sub TextBox1_Change()
If (Right(UserForm2.TextBox1, 1) = "E") Then
Unload Me
Load UserForm1
UserForm1.Show
End If
End Sub

但是当第二个userform打开以后,textbox 的change事件就不触发了。请问是怎么回事?怎么实现此功能呢?谢谢各位高手!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-30 01:25 , Processed in 0.292287 second(s), 14 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表