Split func - "Sub or function is not defined": Wtf!?

the1nk

New Member
Joined
Mar 31, 2008
Messages
16
Hey all.
I'm doing some VBA in Excel 2003 (11.81) it works great. However, when I send the workbook (including the macro) to a customer, she gets a compile error "Sub or function not defined" and highlights "Split" with its parameters. She's using Excel 2003 (11.5). Any ideas what could be causing that ?

Code:
Sub CountStores()
'Original Code by the masterful Bob Shenker
'Modified code by Adam Davis
'Setup the sheets..
Dim shtData As Worksheet
Dim shtSumm As Worksheet
'Setup the ranges..
Dim rngStores As Range
Dim rngSearching As Range
Dim srng As Range
Dim drng As Range
Dim dsrng As Range
'And Misc Variables..
Dim I As Integer
Dim iC As Integer
Dim strNames() As String
Dim iCol As Integer

Set shtData = ActiveWorkbook.Worksheets("Data")
Set shtSumm = ActiveWorkbook.Worksheets("Summary")

Set rngStores = shtSumm.Range("B4", shtSumm.Range("B65536").End(xlUp).Address)
For iCol = 1 To 16
    Set rngSearching = shtData.Range(Chr(72 + iCol) & "2", shtData.Range(Chr(72 + iCol) & "65536").End(xlUp).Address)
    For Each srng In rngStores
        strNames() = Split(srng.Value, ";")
        For Each dsrng In rngSearching
            For iC = LBound(strNames) To UBound(strNames)
                If (InStr(1, dsrng.Value, strNames(iC), vbTextCompare)) Then
                    I = I + 1
                End If
                'DoEvents
            Next iC
            DoEvents
        Next dsrng
        srng.Offset(0, iCol).Value = I
        I = 0
        DoEvents
    Next srng
    DoEvents
Next iCol
End Sub
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi

try prefixing the Split function with VBA:

Code:
strNames() = VBA.Split(srng.Value, ";")

and see if the customer continues to suffer from this problem.
</pre>
 
Upvote 0
the1nk<SCRIPT type=text/javascript> vbmenu_register("postmenu_1633788", true); </SCRIPT>

Ask her if her Excel has unneeded object libraly reference(s).
It sometime cause the problem with the functions.
 
Upvote 0
unneeded library references?

The customer, unfortunately, isn't a coder. :p So, therefore, the VBA settings (and references, I would imagine) should all be standard. I, too, have the standard references on, and no special ones on. :-\ So, I don't think it's that. But maybe she has missing references? I don't know how that would happen though. x_X

Thanks. ;)
 
Upvote 0
Ask the user to check under Tools>References... in the VBA editor.

Shouldn't be too difficult and they might actually find some references marked as MISSING.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,777
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top