Consulting

Results 1 to 2 of 2

Thread: for loop returning 2 numbers

  1. #1

    for loop returning 2 numbers

    I have a for loop stepping in 5's from 0 to 25.

    I need to return 14 for 0, 5, and 10, but then for 15, 20 and 25 I need it to return 33.

    Anyone have any ideas? Or even know if this is possible?

    Many thanks

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Something like

    [VBA]For i = 0 to 25 Step 5
    '...

    ReturnedValue = 33
    If i < 15 then ReturnedValue = 14

    '...
    Next i[/VBA]
    Last edited by mikerickson; 02-15-2013 at 11:56 PM.

Posting Permissions

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