+ Reply to Thread
Results 1 to 3 of 3

Loop in Excell with VBA-code.

  1. #1
    Gunter Schelfhout
    Guest

    Loop in Excell with VBA-code.

    I need a loop in VBA-code which:
    - inserts a value from 1 to 500 in cell N23979
    - reads the value from cell Q23975 and inserts these solutions in cells
    B23980 to B24480 so I can compare the solutions.

    TIA

  2. #2
    JE McGimpsey
    Guest

    Re: Loop in Excell with VBA-code.

    One way:

    Dim i As Long
    Dim rArg As Range
    Dim rRes As Range
    Dim rDest As Range

    Set rArg = Range("N23979")
    Set rRes = Range("Q23975")
    Set rDest = Range("B23979")
    For i = 1 To 500
    rArg.Value = i
    rDest.Offset(i, 0).Value = rRes.Value
    Next i

    Note that the 500 results will only extend to B24479.


    In article <[email protected]>,
    Gunter Schelfhout <[email protected]> wrote:

    > I need a loop in VBA-code which:
    > - inserts a value from 1 to 500 in cell N23979
    > - reads the value from cell Q23975 and inserts these solutions in cells
    > B23980 to B24480 so I can compare the solutions.
    >
    > TIA


  3. #3
    Gunter Schelfhout
    Guest

    Re: Loop in Excell with VBA-code.

    JE McGimpsey wrote:

    [snip]

    >> I need a loop in VBA-code which:
    >> - inserts a value from 1 to 500 in cell N23979
    >> - reads the value from cell Q23975 and inserts these solutions in cells
    >> B23980 to B24480 so I can compare the solutions.


    It works great, thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1