PDA

View Full Version : Solved: turn off features if not found



Djblois
02-27-2007, 07:11 AM
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:

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

unfortunately, it isn't working.

moa
02-27-2007, 07:24 AM
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?

Djblois
02-27-2007, 07:36 AM
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.

moa
02-27-2007, 07:39 AM
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.

Djblois
02-27-2007, 07:41 AM
I have the subrouting behing the form in the userform_activate mod. is that where it should be?

moa
02-27-2007, 07:42 AM
Only other thing would be if you misspelt Division or you are looking in the wrong cell or worksheet

Djblois
02-27-2007, 07:43 AM
Glen,

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

moa
02-27-2007, 07:46 AM
Not a problem.