+ Reply to Thread
Results 1 to 6 of 6

Call code not working

  1. #1
    Registered User
    Join Date
    03-23-2011
    Location
    Anderson SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Call code not working

    I have
    Please Login or Register  to view this content.
    in the Sheet 1 (Code) and test is in Module 1 (Code) and refuses to work. If I run test directly it works, if I put a command instead of the Call in the Worksheet_Change macro it works, but will not call test. Do they need to be in the same location?
    Last edited by IDrinkAlone; 03-23-2011 at 09:56 AM.

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

    Re: Call code not working

    Quote Originally Posted by IDrinkAlone View Post
    if I put a command instead of the Call in the Worksheet_Change macro it works
    That is not possible - you have specified that you do not want an absolute address so the returned string would be "H2" and never "$H$2".
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Call code not working

    Nevermind. romperstomper beat me, and gave a better solution.

  4. #4
    Registered User
    Join Date
    03-23-2011
    Location
    Anderson SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Call code not working

    I have not said I did not want an absolute address, I origninally had H2 and changed to $H$2 based on recommendations on other posts, does not work either way. I want to run test anytime I make a change to H2 in Sheet1.

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,975

    Re: Call code not working

    By using Address(0, 0) you have told the code that you want a relative address, so the string returned will be "H2" and never "$H$2". This should work assuming you have a macro called test and you are manually changing the value of H2 on its own:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-23-2011
    Location
    Anderson SC
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Call code not working

    Okay, I tried with and without the (0,0) and with and without the $'s, but never the right combination, Works great now, thanks.

+ 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