Hi All
I am using the following code in a project and would like some help to loop it until either TRUE or #N/A is found in the active cell.
![]()
Please Login or Register to view this content.
Thanks for any assistance
Jeff
Hi All
I am using the following code in a project and would like some help to loop it until either TRUE or #N/A is found in the active cell.
![]()
Please Login or Register to view this content.
Thanks for any assistance
Jeff
Last edited by VBA Noob; 04-28-2007 at 02:42 AM.
maxwell13
Welcome to Excelforum
Please read the forum rules & wrap your VBA code - see links below
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely
Top Excel links for beginners to Experts
If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assistedor failed to assist you
I welcome your Feedback.
Try something like this,
Erik![]()
Please Login or Register to view this content.
Hi mudraker thanks for the welcome and sorry for not wrapping my code.
Thanks for your reply Erik but i really don't understand what you have posted.
I would like my code to keep repeating itself until a value other than False is found in the active cell. The data in the active cell is the result of an OR function formula returning either False, True or #N/A
Thanks
Jeff
You have to put this code into a macro like
![]()
Please Login or Register to view this content.
Where the range contains all field you want to search in. The For Each .. Next will search all field in the range.
Erik
jeff
Thanks for wrapping your code.
I am not sure I fully understand what you require but try this
When testing an item like a cell value for multiple results Select Case statements are more efficient than If statements![]()
Please Login or Register to view this content.
You can also with with cell values etc without selecting them
Hi mudraker
Thanks for your time and response to my post. I have used your code with a slight edit (changed "False" to "True" )and found it works great except if the value in the selected cell is N/A. If this occurs I get an error and the code stops.
Basically I would like the code to keep repeating until the value in the selected cell is not equal to "False".![]()
Please Login or Register to view this content.
I tried the following but get this
Compile Error Expected: expression
Any further guidance greatly appreciated![]()
Please Login or Register to view this content.
Thanks
Jeff
Off topic: What about Gilly!!!
As you are only interested if the value is not false we can go back to using If statements
![]()
Please Login or Register to view this content.
Thanks for all your help mudraker i have finally got it working.
Ended up using IFNA function to replace the N/A with a zero and then went back to using your Select Case statement.
It works exactly as I wanted!!!
Thanks again
Jeff
good to hear you resolved the problem
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks