Consulting

Results 1 to 4 of 4

Thread: Find Column Difference

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location

    Find Column Difference

    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:

    [vba]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[/vba]

    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?
    Last edited by Djblois; 11-21-2007 at 10:07 AM.

Posting Permissions

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