Results 1 to 1 of 1

Thread: [RESOLVED] Excel 2003 VBA - Split Function(VBA)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2008
    Location
    Colorado
    Posts
    193

    Resolved [RESOLVED] Excel 2003 VBA - Split Function(VBA)

    The following code is failing for me:
    Code:
    Sub ConvertArray()
        Dim SCell As String
        Dim TempArray() As String
        For Each Cell In WorkSheets("Sheet1").Range("RangeName")
            If Cell <> "" Then
                SCell = Cell.Value
                TempArray = Split(SCell,"|")
            End If
        Next Cell
    End Sub
    When I try to use this I get the following error message "Compile Error: ByRef argument type mismatch"

    The help topic states:
    Split(expression[, delimiter[, limit[, compare]]])

    expression Required. String expression
    I'm not sure where I'm going wrong. I declared my "SCell" variable as a string... when I step through the code (setting the Split line to a comment), it evaluates okay as a string. It looks exactly like some other code examples that I have (that I trust the source, yet I haven't tested them).

    Can anyone see where I'm going wrong?

    Edit: Even webtest's code from this thread gives me the same error.
    Edit2: When I'm typing and I've typed "Split(" It displays "Split(Multi As Integer)". <--- Wow, I feel stupid. I had defined a public function in a different module called "Split".
    Last edited by Fizziii; Jul 14th, 2008 at 02:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width