+ Reply to Thread
Results 1 to 4 of 4

Loop Statement

  1. #1
    Registered User
    Join Date
    09-07-2003
    Posts
    10

    Loop Statement

    I've got the following code:

    Range("K5").Select
    If ActiveCell.Value <> "" Then
    Selection.Copy
    Range("K8").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End If

    As you'll notice the two key cells are K5 and K8.

    I want to be able to repeat this bit of code for L5/L8, M5/M8, N5/N8 . . . right up to EF5/EF8

    Apart from just repeating the code with different cell references, how would I do a loop statement to take care of this a little more efficiently?

    Thanks for your help.

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Dust For Eyes
    I've got the following code:

    Range("K5").Select
    If ActiveCell.Value <> "" Then
    Selection.Copy
    Range("K8").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End If

    As you'll notice the two key cells are K5 and K8.

    I want to be able to repeat this bit of code for L5/L8, M5/M8, N5/N8 . . . right up to EF5/EF8

    Apart from just repeating the code with different cell references, how would I do a loop statement to take care of this a little more efficiently?

    Thanks for your help.
    Hi,

    looks weird, but something like
    Please Login or Register  to view this content.
    should help.

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    09-07-2003
    Posts
    10
    That's working.

    Thanks for your help.

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Dust For Eyes
    That's working.

    Thanks for your help.
    good to see, and thanks for your response.

    ---

+ 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