Excel精英培训网

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

[问题] 无模式窗体可以切换到其他程序,但不能切换其他工作簿

[复制链接]
发表于 2017-10-26 11:49 | 显示全部楼层 |阅读模式
写了几句滚动屏语句,基本实现了功能,但(用SHOW 0模式)无模式窗体还是像独占一样,窗体显示后无法切切换到其他的工作簿中,非要关掉窗体才可切换过去,但可以切换到本工作簿中的其他工作表中,不用关闭窗体,求各位帮助看一下代码,第一次用DOEVENTS事件,应该是在停循环时没有交出系统管理权,谢谢各位!

Sub show_tips()
Dim i As Integer
Dim j As Integer
Dim d As Date
nrow_s3 = Sheet3.Range("A65536").End(xlUp).Row - 2
If nrow_s3 < 3 Then
Exit Sub
End If
If nrow_s3 Mod 3 = 0 Then
   j = 0
  Else
   j = 3
End If
  Do While IsForm2Load = True
     DoEvents
    For i = 3 To nrow_s3 + j Step 3
        DoEvents
       If IsForm2Load = False Then
      
       Exit Sub
       End If
      UserForm2.Label59.Caption = Sheet3.Range("a" & i)
      UserForm2.Label60.Caption = Sheet3.Range("a" & i + 1)
      UserForm2.Label61.Caption = Sheet3.Range("a" & i + 2)
         d = Now
         Do While Now - d < TimeValue("00:00:03")
          DoEvents
         Loop
     Next i
         
  Loop
   
End Sub

1.jpg

流程.zip

70.09 KB, 下载次数: 0

内容

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-8-16 08:19 , Processed in 0.180324 second(s), 7 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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