+ Reply to Thread
Results 1 to 3 of 3

Repeating macro for various worksheets to complete lines in consolidation sheet

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Canterburym England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Repeating macro for various worksheets to complete lines in consolidation sheet

    Hi,

    I am trying to run the following instruction to complete a table, but want this to fill each new row for each worksheet in the book via a macro:

    ActiveCell.FormulaR1C1 = _
    "=IF('MX9522'!R[73]C[3]>('MX9522'!RC[3]*1.1),'MX9522'!RC,""Below threshold"")"
    Range("A2").Select
    Columns("A:A").EntireColumn.AutoFit
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "='MX9522'!RC[2]"
    Range("C2").Select
    ActiveCell.FormulaR1C1 = "='MX9522'!R[73]C[1]"
    Range("D2").Select
    ActiveCell.FormulaR1C1 = "=(RC[-1]/RC[-2])*100"

    Can anyone help how to write the macro for this to occur?

    Thanks in advance,

    Ross

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Repeating macro for various worksheets to complete lines in consolidation sheet

    If the code works for a single sheet, you can make to work across sheets, but the code will not know which one is the active cell in this line

    Please Login or Register  to view this content.
    The rest of the code have selected range, but not this line.
    What is the name of cell or range for this active cell?

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Repeating macro for various worksheets to complete lines in consolidation sheet

    Assuming that the first line active cell is A2, try this code

    Please Login or Register  to view this content.

+ 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