www.zbgf.net > VBA的sElECt CAsE用法

VBA的sElECt CAsE用法

Private Sub CB1_Click() Select Case Sheet1.Range("A1") Case "A" Sheet1.Range("A3") = "联想" Case "B" Sheet1.Range("A3") = "华硕" Case "C" Sheet1.Range("A3") = "惠普" Case "D" Sheet1.Range("A3") = "IBM" Case "E" Sheet1.Range("A3...

123456789Sub test() bianliang = "fdbbdf" Select Case True Case bianliang Like "*bb*" Call BB Case Else Call CC End SelectEnd Sub

不明白你说的, 但你可以仿照下面的语法自己写 Case语句的语法如下: Select Case 测试表达式 Case Is 条件1 如果条件1为真时执行的语句 Case Is 条件2 如果条件2为真时执行的语句 Case Is 条件N 如果条件N为真时执行的语句 End Select 例如,我...

'如果一定要使用SELECT CASE,建议这样写 Select Case Range("a1") Case Is < 0: MsgBox "z" Case 0 To 10: MsgBox "a" Case 11 To 15: MsgBox "b" Case 16 To 20: MsgBox "c" Case 21 To 30: MsgBox "b" Case 31 To 40: MsgBox "c" Case Is > 4...

Select Case语句也是条件语句之一,而且是功能最强大的条件语句。它主要用于多条件判断,而且其条件设置灵活、方便,在工作中使用频率极高。本节介绍Select Case语句的语法及应用案例. Select Case语句的语法如下: Select Case testexpression...

select case [a1] case 接你的条件 msgbox "" case 条件 msgbox"" case 条件 msgbox … select case next 手机打的,代码不完整,就是这意思

如果是与的关系 嵌套判断,优先级高的放外层! Select Case 变量1 Case xxx Select Case 变量2 Case xxx Func End SelectEnd Select如果是或的关系 放Else里 Select Case 变量1 Case xxx Func Case Else Select Case 变量2 Case xxx Func End Sel...

Select Case ture 是什么意思? 难道你写了一个 Select Case true ? 永远成立的意思?

先说下你第一段代码:Dim iCounter As IntegerDim weekNames As StringFor iCounter = 1 To 5If iCounter = 1 ThenweekNames = "Monday"ElseIf iCounter = 2 ThenweekNames = "Tuesday"ElseIf iCounter = 3 ThenweekNames = "Wednesday"ElseIf i...

你一直检查到X,那么结果保存到Z吧,空一列,你可以修改为X,代码如下: Sub 宏1() dim i,j,r i=3 '从第三行开始 while cells(i,1)"" r="" for j=6 to 24 if cells(i,j)0 then r=r & chr(64+j) next j cells(i,"Z")=r i=i+1 wendEnd Sub

网站地图

All rights reserved Powered by www.zbgf.net

copyright ©right 2010-2021。
www.zbgf.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com