+ Reply to Thread
Results 1 to 13 of 13

Trying to get two functions to work together

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Trying to get two functions to work together

    Hi. im sure this is an easy fix (i hope) but im trying to get 2 functions to work (one calling the other) and i keep getting an error message (see Attached)

    Please Login or Register  to view this content.
    Any Help would be greatly appreciated
    Attached Images Attached Images

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Trying to get two functions to work together

    On which line?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Trying to get two functions to work together

    Quote Originally Posted by romperstomper View Post
    On which line?
    how do i find that out. the error doesnt give a line number

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Trying to get two functions to work together

    Put a breakpoint in the first function, then when it runs, use f8 to step through line by line until it fails.

  5. #5
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Trying to get two functions to work together

    Quote Originally Posted by romperstomper View Post
    On which line?
    the error occurs at this point

    Please Login or Register  to view this content.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Trying to get two functions to work together

    Can you post a sanitised workbook as it's kind of hard to guess what sorts of values you are passing where. Nothing springs out as syntactically wrong on that statement.

  7. #7
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Trying to get two functions to work together

    all the code is activated from workbook_change.

    EDIT: I should probably add that u need to enter a number into col C in the format that is already there.
    Attached Files Attached Files
    Last edited by Aussiexile; 11-18-2010 at 07:24 PM.

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Trying to get two functions to work together

    Your code is looking for a name called "Correspondence" which doesn't exist.

  9. #9
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Trying to get two functions to work together

    Quote Originally Posted by romperstomper View Post
    Your code is looking for a name called "Correspondence" which doesn't exist.
    crap. it does in the other sheet. sorry i thought i fixed those up

    will fix it up and repost it.

    sorry for the run around

    EDIT: new excel attached
    Attached Files Attached Files
    Last edited by Aussiexile; 11-21-2010 at 06:28 PM.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Trying to get two functions to work together

    Your issue is this line:
    Please Login or Register  to view this content.
    in the PopDocTypeDisc function. Since DocTypeArray does not contain range objects, but strings, you cannot use Offset. (you can't offset from a string)

  11. #11
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Trying to get two functions to work together

    Quote Originally Posted by romperstomper View Post
    Your issue is this line:
    Please Login or Register  to view this content.
    in the PopDocTypeDisc function. Since DocTypeArray does not contain range objects, but strings, you cannot use Offset. (you can't offset from a string)
    would
    Please Login or Register  to view this content.
    fix the issue and if not any suggestions on how i resolve the issue?

    on a side note thanx for all the help so far romper

  12. #12
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Trying to get two functions to work together

    It would certainly stop the error, but I don't know whether it would fix the issue, since I'm not sure what you were trying to achieve with the original code. If you were simply trying to use the next item in the array, then yes that will be fine.

  13. #13
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Trying to get two functions to work together

    Quote Originally Posted by romperstomper View Post
    It would certainly stop the error, but I don't know whether it would fix the issue, since I'm not sure what you were trying to achieve with the original code. If you were simply trying to use the next item in the array, then yes that will be fine.
    yeah on this particular item i have 2 discriptions that contain the same first letter in the code eg
    one would be T1A and the other is TC the number or second letter changes so i need to check and see if the second char is a number if it is its "this" if its not its "that"

    thanx will give that a burl and hopefully it will work

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1