Djblois
11-21-2007, 09:19 AM
I created a Function to find the column difference between whatever column number I pass to the function and what ever column it finds a particular string in. It was working, however it isn't working anymore and when I tested it and watched the value it says "<Expression not defined in Context>". Here is the function:
Function fnFindColumnDif(ByVal lColtoSubtract As Integer, ByVal sToFind As String) As Integer
Dim lColSubtractFrom As Integer
'Find Column# to Subtract
lColSubtractFrom = Range(Cells(1, 1), Cells(1, FinalColumn(wsWorking))).Find(What:=sToFind).Column
'Find Column Difference
fnFindColumnDif = lColSubtractFrom - lColtoSubtract
End Function
I also watched the lColSubtractFrom and it was correct and I watched lColtoSubtract and it was also correct but they aftert the last line finFindColumnDif is still empty and says "<Expression not defined in Context>" in the value column.
Does anyone know what "<Expression not defined in Context>" means?
Function fnFindColumnDif(ByVal lColtoSubtract As Integer, ByVal sToFind As String) As Integer
Dim lColSubtractFrom As Integer
'Find Column# to Subtract
lColSubtractFrom = Range(Cells(1, 1), Cells(1, FinalColumn(wsWorking))).Find(What:=sToFind).Column
'Find Column Difference
fnFindColumnDif = lColSubtractFrom - lColtoSubtract
End Function
I also watched the lColSubtractFrom and it was correct and I watched lColtoSubtract and it was also correct but they aftert the last line finFindColumnDif is still empty and says "<Expression not defined in Context>" in the value column.
Does anyone know what "<Expression not defined in Context>" means?