1

I have a spreadsheet to track jobs that go through the workshop, on a separate sheet i have a macro that will only show live jobs. To determine which jobs to display, on the main sheet i have used an if statement formula like below:

=IF(NW3="complete","0","1")

so if a job is listed as complete it will show a 0

I have then written VBA code that will detect if each row in the correct column contains a 1, if so it will copy and paste that row into the live jobs sheet. however the VBA loop code does not recognise the number generated by the IF statement.

I know my code works because if i manually type a 1 or 0 in the columns instead of using the IF formula above, the VBA code finds all the results. I also made a random =SUM statement by dividing a cell by itself to give 1 and then ran the macro and again it worked. So it is only IF statement results it doesn't like.

Im stumped, please help!

1
  • Did you notice that =IF(NW3="complete","0","1") puts in a number as a string but =IF(NW3="complete",0,1) are real numbers. • If this doesn't solve your issue edit the question and add your code please. We cannot provide help on code that we don't see. Commented Feb 12, 2019 at 7:56

1 Answer 1

2

=IF(NW3="complete","0","1") this formula giving you 1 and 00 as text not as number. So, change the formula to =IF(NW3="complete",0,1) which will give you output as number. Then VBA should work fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.