SteveOranjin
Board Regular
- Joined
- Dec 18, 2017
- Messages
- 170
I am starting to develop a tool that will enforce good practices in data loading. I'm new to VBA, so I probably shouldn't be doing this. Having said that, I'm getting an error on this code.
The error i get is, "Compile Error: Sub or Function Not Defined" and it is highlighting the section of the code that I have bolded and underlined.
Can someone please help me get this to work, and to work in such a way that it doesn't wig out if there are other headers/more columns than just three? Also, if there are no columns I'd like it to work as well.
Steve
Rich (BB code):
Sub Check() Application.EnableEvents = False
Dim ColumnHeaderArr(0 To 2) As String
ColumnHeaderArr(0) = "SKU"
ColumnHeaderArr(1) = "BrandName"
ColumnHeaderArr(2) = "BrandCode"
If VerifyHeaders(ColumnHeaderArr) = True Then
Msg = "All headers are present"
Else
Msg = "You are missing headers"
End If
Application.EnableEvents = True
End Sub
The error i get is, "Compile Error: Sub or Function Not Defined" and it is highlighting the section of the code that I have bolded and underlined.
Can someone please help me get this to work, and to work in such a way that it doesn't wig out if there are other headers/more columns than just three? Also, if there are no columns I'd like it to work as well.
Steve