Consulting

Results 1 to 8 of 8

Thread: Solved: turn off features if not found

  1. #1
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location

    Solved: turn off features if not found

    I am trying to use some code to turn off certain features if I it doesn't find "Division" in V1. This is the code that I am using:

    [VBA]Set findString = Detail.Range("V1").Find(What:="Division")
    If findString Is Nothing Then
    SalesReport.MultiPage1.Pages(5).Enabled = False
    End If[/VBA]

    unfortunately, it isn't working.

  2. #2
    VBAX Contributor moa's Avatar
    Joined
    Nov 2006
    Posts
    177
    Location
    What is the error message and what part of the code is giving you grief?

    Is SalesReport the name of your form?

    Is findString a range object?
    Glen

  3. #3
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    Moa it isn't giving me an error message it is just not disabling the advanced page in my multipage. Yes, findstring is a range object and salesreport is the name of the form.

  4. #4
    VBAX Contributor moa's Avatar
    Joined
    Nov 2006
    Posts
    177
    Location
    The code should work fine so maybe you aren't calling the subroutine that holds that code. Have you debugged? I'd use "step into" to see what's going on.
    Glen

  5. #5
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    I have the subrouting behing the form in the userform_activate mod. is that where it should be?

  6. #6
    VBAX Contributor moa's Avatar
    Joined
    Nov 2006
    Posts
    177
    Location
    Only other thing would be if you misspelt Division or you are looking in the wrong cell or worksheet
    Glen

  7. #7
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    Glen,

    THank you for your help, it was a stupid mistake-I hade it in userform_click not userform_initialize. THank you

  8. #8
    VBAX Contributor moa's Avatar
    Joined
    Nov 2006
    Posts
    177
    Location
    Not a problem.
    Glen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •