+ Reply to Thread
Results 1 to 5 of 5

Create macro that calculates the same formula depending on how much data

  1. #1
    Registered User
    Join Date
    08-26-2016
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    25

    Create macro that calculates the same formula depending on how much data

    Hi,

    attached is a simple macro im playing around with. What I want to do is that depending on what data I put in the tab "admindata", the formula should follow how many rows that are filled in "Artno" in tab "RRP". Now the formula is based on a specific range. So depending how much data I put in "Admindata", the formula should follow how many rows that are filled in tab "RRP".
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Create macro that calculates the same formula depending on how much data


    Hi !

    Just apply a name for the range and use this name within formula …

  3. #3
    Registered User
    Join Date
    08-26-2016
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    25

    Re: Create macro that calculates the same formula depending on how much data

    okay, but I want the range to depend on how much data it is in column A. Will this work?

  4. #4
    Registered User
    Join Date
    08-26-2016
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    25

    Re: Create macro that calculates the same formula depending on how much data

    What I mean is that

    PHP Code: 
     Range("B2").Select
        Selection
    .FormulaArray _
            
    "=INDEX(admindata!R2C5[B]:R8827[/B]C5,MATCH(RRP!R1C&RRP!RC1,admindata!R2C1:R8827C1&admindata!R2C2:R8827C2,0),1)"
        
    Selection.AutoFill Destination:=Range("B2:R2"), Type:=xlFillDefault
        Range
    ("B2:R2").Select
        Selection
    .AutoFill Destination:=Range("B2:[B]R519[/B]"), Type:=xlFillDefault
        Range
    ("B2:R519").Select 
    The formula now goes to the index in "admindata" up to row 8827 -> which I want to go to the last cell in that range. And the "autofill" only goes to row 519, which I want to as far as how much data I have in column A in tab "RRP". How can I make this happen?

  5. #5
    Registered User
    Join Date
    08-26-2016
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    25

    Re: Create macro that calculates the same formula depending on how much data

    can anyone help me?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 03-24-2016, 08:21 AM
  2. Replies: 7
    Last Post: 03-22-2016, 11:57 AM
  3. [SOLVED] Macro to add rows depending on the size of data volume and create new workbook
    By bimmy80 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-16-2015, 11:05 AM
  4. [SOLVED] How to run a macro to put in a formula which calculates the week ending date
    By sandman85 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2015, 08:06 PM
  5. Need macro that calculates two formula but displays only one of them in column
    By jro4 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2013, 11:32 AM
  6. Macro that calculates formula when entered from one sheet to another
    By EXCEL0429 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-24-2013, 09:05 PM
  7. [SOLVED] Macro that automateically calculates the median and subtracts it from a list of data
    By Bealey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2012, 01:55 AM

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