+ Reply to Thread
Results 1 to 4 of 4

Help Returning A Function Boolean

  1. #1
    Registered User
    Join Date
    01-27-2008
    Posts
    30

    Help Returning A Function Boolean

    hi all,

    just wondering on how to build a function, basicly i want the function to
    test is activeworkbook.haspassword is true of false, then if the function is true, the
    returned message should be "This Book Is Protected", and if false "This Book in non Protected".

    and to use the function like so, if i have a userform4 with a textbox2 on it,

    i want to type Public sub Command1_click()
    CheckBookPass (textbox2.text)

    and the returnes string in Textbox2.text would be This Book Is Protected is true. on so on,

    thank you
    Last edited by viruzman; 05-11-2012 at 09:13 AM.

  2. #2
    Registered User
    Join Date
    01-27-2008
    Posts
    30

    Re: Help Returning A Function Boolean

    Does anyone have a solution.

    thank you

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help Returning A Function Boolean

    Hello ,

    Add a VBA Module to your workbook and paste this code into it.
    Please Login or Register  to view this content.
    Here iscode for Command1
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    01-27-2008
    Posts
    30

    Re: Help Returning A Function Boolean

    huh, seems to work good thank you,

    must of been coding too much lately. thenk you appreciated.

+ 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