Consulting

Results 1 to 2 of 2

Thread: iteration loop

  1. #1

    iteration loop

    I need a VBA Iteration loop.

    Event will be value of cell (selection setting)

    If Cell E5 = 4.......
    If cell F5 < G5 add 0.001 to cell A5
    If cell F5 = G5 end sub

    Any help is welcome.

    w

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Not sure what ... Event will be value of cell (selection setting) ... means, but here goes

    [vba]

    For Each cell In Range(Range("A5"), Range("A5").End(xlDown))

    If cell.Value = 4 Then

    If cell.Offset(0, 1).Value < .cell.Offset(0, 2).Value Then

    cell.Offset(0, -4).Value = cell.Offset(0, -4).Value + 0.001

    ElseIf cell.Offset(0, 1).Value = .cell.Offset(0, 2).Value Then

    End Sub
    End If
    End If
    Next cell
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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