Results 1 to 7 of 7

Using Loops for Repetitive Task

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Using Loops for Repetitive Task

    Hi I'm very new to VBA and am learning. I recorded a macro as below. Can it be simplified using a Loop function somehow? I would like to loop until Column A is empty. Thank you. Felix

    Sub PAIRING()
    
        Range("D1").Select
        ActiveCell.FormulaR1C1 = "=RC[-3]"
        Range("E1").Select
        ActiveCell.FormulaR1C1 = "=RC[-3]"
        Range("E2").Select
        Sheets("Analysis").Select
        Selection.Copy
        Sheets("PAIRS").Select
        Range("C1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
        Range("D1").Select
        ActiveCell.FormulaR1C1 = "=R[1]C[-3]"
        Range("E1").Select
        ActiveCell.FormulaR1C1 = "=R[1]C[-3]"
        Range("E2").Select
        Sheets("Analysis").Select
        Selection.Copy
        Sheets("PAIRS").Select
        Range("C2").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
        Range("D1").Select
        ActiveCell.FormulaR1C1 = "=R[2]C[-3]"
        Range("E1").Select
        ActiveCell.FormulaR1C1 = "=R[2]C[-3]"
        Range("E2").Select
        Sheets("Analysis").Select
        Selection.Copy
        Sheets("PAIRS").Select
        Range("C3").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    End Sub
    Last edited by fa888; 10-20-2010 at 02:14 AM. Reason: I violated forum rules regarding code/tags and title description.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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