dcsimg
Results 1 to 2 of 2

Thread: [RESOLVED] Need an equation

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    539

    Resolved [RESOLVED] Need an equation

    I need an equation that when I go through a For...Next loop it returns a value in variable q2 but I don't know how to figure it out

    Example:

    if q1 =
    1 through 25 then q2 = 26
    26 through 50 then q2 = 51
    51 through 75 then q2 = 76
    '
    etc
    etc
    '
    601 through 625 then q3 = 626

    Code:
    For q1 = 1 To 625
      q2 = ???
    Next q1
    Last edited by Code Dummy; Apr 21st, 2019 at 01:05 AM.

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,204

    Re: Need an equation

    Code:
      Dim q1 As Long, q2 As Long
    
      For q1 = 1 To 625
        q2 = ((q1 - 1) \ 25 + 1) * 25 + 1
      Next

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width