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 ?
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: