+ Reply to Thread
Results 1 to 3 of 3

Looping Macro

Hybrid View

ashar Looping Macro 05-20-2013, 03:54 PM
ashar Re: Looping Macro 05-20-2013, 03:55 PM
protonLeah Re: Looping Macro 05-20-2013, 07:50 PM
  1. #1
    Registered User
    Join Date
    05-20-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Looping Macro

    I have this recorded macro and would like for it to loop for the rows in colum b which have data.
    what it should be doing is taking the 'name' in column B, inserting that value into the worksheet named Universe Information Ratio and spit back out the results in the corresponding rows in the first sheet. Then it copy and paste specials values and continues all the way down until there is no longer any data in column b

    Sub loopfeed()
    '
    ' loopfeed Macro
    '
    ' Keyboard Shortcut: Ctrl+d
    '
    Sheets("Universe Information Ratio").Select
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "='Universe Macro'!RC"
    Range("B3").Select
    Sheets("Universe Macro").Select
    Range("D2").Select
    ActiveCell.FormulaR1C1 = "='Universe Information Ratio'!RC[2]"
    Range("E2").Select
    ActiveCell.FormulaR1C1 = "='Universe Information Ratio'!RC[2]"
    Range("G2").Select
    ActiveCell.FormulaR1C1 = "='Universe Information Ratio'!RC[1]"
    Range("H2").Select
    ActiveCell.FormulaR1C1 = "='Universe Information Ratio'!RC[1]"
    Range("D2:E2").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Range("G2:H2").Select
    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Application.CutCopyMode = False
    End Sub

  2. #2
    Registered User
    Join Date
    05-20-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Looping Macro

    how do i go about looping this macro?

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,935

    Re: Looping Macro

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Ben Van Johnson

+ 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