+ Reply to Thread
Results 1 to 4 of 4

Function to return boolean if activeworkbook name has specific text

  1. #1
    Registered User
    Join Date
    11-25-2007
    Posts
    46

    Function to return boolean if activeworkbook name has specific text

    I am looking for a function to compare the Activeworkbook's name to see if it has the text "Cycle" in the name. If yes return a boolean "True" and if not Boolean "False". The text "Cycle" can be passed to the function to make the function more generally useful.

    I have tried my hand a bit and am failing. I copied a function I found that looked at a range of cells looking for text. But it is not working. Maybe best to start fresh?

    Below is the code calling the function

    Please Login or Register  to view this content.
    Below is the function. I don't understand the use of "Byval". The code seem to die on the Dim sText as String. Again might be best to start new.

    Please Login or Register  to view this content.
    Cam

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    try this

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,204
    Please Login or Register  to view this content.
    Last edited by mikerickson; 01-13-2008 at 04:08 PM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Registered User
    Join Date
    11-25-2007
    Posts
    46

    Many Thanks

    This forum and you guys are fantastic. Thanks for the help.

    I did modify slightly to allow me to pass the string I want to check for in the myval variable.

    Please Login or Register  to view this content.
    And I use the file name to determine the value of irowmax to be used (Cycle files need irowmax = 36)

    Please Login or Register  to view this content.
    Again many thanks.

    Cam

+ 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