+ Reply to Thread
Results 1 to 2 of 2

Passing aCell Value(Yes/No) into a function?

  1. #1
    Registered User
    Join Date
    03-31-2007
    Posts
    26

    Passing aCell Value(Yes/No) into a function?

    Hi all,

    At the main spreadsheet, i got this 3 cell which contain a dropdown list which contain only YES or NO option. I done it using data validation(list, YES,NO). I wanted to write a function so that i can refer to it inside my CASE select(i need to repeat a lot of time within the Case select thus wanted to write a function for it). I was wondering whether anything wrong with my code? Q61 is the cell which contain the YES/NO dropdown list selection. Or is this not the method to pass a cell value into a function?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    What you want to do is not a function. Functions return a value, you want to hide rows. So your use of a Sub rather than a function is proper.

    As for the syntax, what do you want to pass to the sub, strings or ranges?

    As written, you are passing strings and the line in your main routine should read:
    Please Login or Register  to view this content.
    If you want to pass ranges as the arguments, the sub would be
    Please Login or Register  to view this content.
    called by
    Please Login or Register  to view this content.
    This will accept both ranges and strings as arguments
    Please Login or Register  to view this content.

+ 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