Results 1 to 7 of 7

Automate Formula for each row

Threaded View

  1. #1
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Automate Formula for each row

    Dear Members,

    I have a Scenario where in the Sheet 1 columns (N, O, P, Q, R) have formulas.
    How do i create a VBA script which will help copy all the formualas to each row..

    There are only 18 rows, but in future it may grow to lakhs..
    SO how do we convert this formula to VBA code & then Paste special it.. so that after execution the Formulas will not be seen.. Only values... Please suggest.

    Attaching the sample file where Cloumns(N, O, P, Q, R) needs to be automated

    Below is the Sample code recorded macro

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        Range("N2").Select
        ActiveCell.FormulaR1C1 = _
            "=SUM(RC[-12],RC[-11],RC[-10],RC[-9],RC[-7],RC[-3],RC[-2],RC[-1])"
        Range("O2").Select
        ActiveCell.FormulaR1C1 = "=SUM(RC[-9],RC[-7])"
        Range("P2").Select
        ActiveCell.FormulaR1C1 = "=SUM(RC[-7],RC[-6])"
        Range("Q2").Select
        ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-16],Sheet2!C1:C4,4,0)"
        Range("R2").Select
        ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-17],Sheet2!C1:C4,2,0)"
        Range("N2:R2").Select
        Selection.AutoFill Destination:=Range("N2:R18")
        Range("N2:R18").Select
        Range("P4").Select
    End Sub
    Attached Files Attached Files
    Last edited by Parth007; 03-02-2015 at 07:16 AM.
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using VBA to update automate a formula
    By nav505 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-27-2013, 06:12 PM
  2. How to automate a formula on a table
    By padraigb in forum Excel General
    Replies: 5
    Last Post: 05-09-2010, 09:41 PM
  3. [SOLVED] How can I automate something to be added to a formula in excel?
    By Reepicheep in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-17-2005, 10:30 AM
  4. [SOLVED] Automate Run Rate Formula
    By Juan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2005, 06:06 PM

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