SPLIT
Macro Sheets OnlyEquivalent to choosing the Split command from the Window menu or to dragging the split bar in the active window's scroll bar. Splits the active window into panes. Use SPLIT when you want to view different parts of the active document at the same time.SyntaxSPLIT(col_split, row_split)Col_split specifies where to split the window vertically and is measured in columns from the left of the window.Row_split specifies where to split the window horizontally and is measured in rows from the top of the window.If an argument is 0 and there is a split in that direction, the split is removed. If an argument is omitted, a split in that direction is not changed.Related FunctionFREEZE.PANES Freezes or unfreezes the panes of a windowList of Command-Equivalent Functions

解决方案 »

  1.   

    split这个函数是用来把一个字符串分成以其中某个字符为界的子字符串
    反回的是一个变体类型的数组,它有两个参数,第一个是所要分隔的字串
    第二个是某个字符,如“,”。使用可以参看如下代码:
    dim s as string
    dim a() as varint
    s="1,2,3,4,5,"
    a=split(s,",")
    则a的结果为:
    a(0)=1,a(1)=2,a(2)=3,a(3)=4,a(4)=5
    当然边界可以用一个函数加以区别
      

  2.   

    '分解{0000;0001;}的字符为字符数组
    Public Function SYS_SplitString(ByVal strSplitString As String, ByVal strSplitChar As String) As String()
        Dim i As Integer
        Dim intPos1 As Integer
        Dim intPos2 As Integer
        
        Dim aryResultString() As String
        
        If Right(strSplitString, 1) <> strSplitChar Then
            strSplitString = strSplitString + strSplitChar
        End If
        
        i = 1
        intPos1 = 1
        intPos2 = 1
        Do While True
            
            intPos2 = InStr(intPos1, strSplitString, strSplitChar)
            
            If intPos2 = 0 Then
                Exit Do
            End If
            
            ReDim Preserve aryResultString(1 To i)
            aryResultString(i) = Left(strSplitString, intPos2 - 1)
            
            strSplitString = Mid(strSplitString, intPos2 + 1, Len(strSplitString) - intPos2)
            i = i + 1
        Loop
        
        SYS_SplitString = aryResultString
    End Function
      

  3.   


    Split函数
          描述返回一个下标从零开始的一维数组,它包含指定数目的子字符串。语法Split(expression[, delimiter[, count[, compare]]])Split函数语法有如下几部分:部分 描述 
    expression 必需的。包含子字符串和分隔符的字符串表达式 。如果expression是一个长度为零的字符串(""),Split则返回一个空数组,即没有元素和数据的数组。 
    delimiter 可选的。用于标识子字符串边界的字符串字符。如果忽略,则使用空格字符(" ")作为分隔符。如果delimiter是一个长度为零的字符串,则返回的数组仅包含一个元素,即完整的 expression字符串。 
    count 可选的。要返回的子字符串数,–1表示返回所有的子字符串。 
    compare 可选的。数字值,表示判别子字符串时使用的比较方式。关于其值,请参阅“设置值”部分。 
    设置值compare参数的设置值如下:常数 值 描述 
    vbUseCompareOption –1 用Option Compare语句中的设置值执行比较。 
    vbBinaryCompare 0 执行二进制比较。 
    vbTextCompare 1 执行文字比较。 
    vbDatabaseCompare 2 仅用于Microsoft Access。基于您的数据库的信息执行比较。