+ Reply to Thread
Results 1 to 1 of 1

VBA Won't call Sub from ELSE

  1. #1
    Registered User
    Join Date
    MS-Off Ver
    Excel 2003=7

    VBA Won't call Sub from ELSE


    Below I have posted my commented code. My primary problem at the moment is that within the function I have an IF statement (the VLOOKUP I achieved by recording a macro and works) and an Else. If the function goes into the else I want it to call my Main Sub. However, none of my code within my ELSE works within the ELSE....it works if I move it above the IF (just under all my DIM's). I don't know if I am missing a rule of VBA or something similar.....but all help is appreciated!!

    Secondly... if this can be done it would be really helpful...I would like it if the value I am looking up in my VLOOKUP was the cell that the user selected as the Dependency. I have tried entereing Dependency.Address...changing Dpeendency to 'as range'....trying to take the range beforehand putting it into the VLOOKUP and tried ActiveCell.Offset(0,-2)...unsuccesfully! Because at the moment, for the VLOOKUP to work (if the Dependency qualifies in the IF) then I would need to drag the formula down in the worksheet to get the correct value I am looking up....I can't just enter the formula in a cell (say halfway down my worksheet) as it will VLOOKUP on the cell 'RC[-7]'.

    I have attached an example workbook to help with the understanding of what I'm trying to do... Thanks

    P.S the million MsgBoxs within my code I have commented out are from when I have been trying to debug!
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Repeat call count for call center
    By arifmasum in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-08-2013, 10:03 PM
  2. How to set call count according to call date and time
    By naveen4pundir in forum Access Tables & Databases
    Replies: 0
    Last Post: 04-27-2012, 02:13 AM
  3. using CALL to call methods mandatory?
    By jerryliang2k in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2008, 06:16 PM
  4. Replies: 3
    Last Post: 06-28-2006, 01:20 PM
  5. Replies: 2
    Last Post: 06-25-2006, 12:10 PM

Tags for this Thread


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