标题:怎样声明或放置公共数组
取消只看楼主
vbcaonia
Rank: 1
等 级:新手上路
帖 子:97
专家分:0
注 册:2016-5-4
结帖率:100%
已结贴  问题点数:20 回复次数:0 
怎样声明或放置公共数组
Dim brr()是Sub 按钮4_Click()与Function GetB(bstr, c) 的公用数组,必须放在Sub 按钮4_Click()上,请问应该怎样声明或放置,放在Sub 按钮3_Click()后面提示end sub怎样...要求Dim brr()只在Sub 按钮4_Click()+函数中起作用

Sub 按钮3_Click()
................
end sub

Dim brr()
Sub 按钮4_Click()
    xstep = 21     '每组多少行
    ReDim Err(1 To UBound(crr) / xstep + 1, 1 To 2)
    For i = 1 To UBound(brr)     
        b0 = b0 & "," & i
    Next
    b0 = Mid(b0, 2)
    .................
            c = crr(i + k, 1)
            bstr = GetB(bstr, c)  
            If Len(bstr) = 0 Then GoTo 100     
            If Len(bstr) And InStr(bstr, ",") = 0 Then   
                n = n + 1
                'Err(n, 1) = brr(bstr, 1)   
                ............
100:    Next i
End Sub

Function GetB(bstr, c)     
    cc = " " & Mid(c, 5) & " "     
    bb = Split(bstr, ",")
    For Each i In bb
        b = brr(i, 1)
        xrr = Split(b, " ")
        s = 0
        ..........
        If s >= xmin And s <= xmax Then GetB = GetB & "," & i
    Next
    GetB = Mid(GetB, 2)
End Function

[此贴子已经被作者于2022-11-27 23:13编辑过]

搜索更多相关主题的帖子: end Sub 按钮 声明 数组 
2022-11-27 23:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-510800-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012814 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved