+ Reply to Thread
Results 1 to 7 of 7

Formula macro

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    55

    Formula macro

    Hi,

    I have the following macro that works perfect to copy cells from Sheet "Parameters" to all active sheets. However, a lot of the cells contain formulas that require 'CTRL+SHIFT+ENTER' to work. Is there a way the macro below can be modified so that such macros automatically work when copied, rather than me doing the cells individually which would take a long time!

    Thank you

    Sub dtrom()
    Dim ws As Worksheet


    For Each ws In Worksheets
    ws.Range("N1:AG3000").Formula = Sheets("Parameters").Range("N1:AG3000").Formula
    Next ws


    End Sub

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula macro

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Formula macro

    My VBA is weak, but surely if you copy a formula - regular or array - it will get copied the same wahy doinfg it manually, or via a macro? It is a copy/paste function?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    07-21-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    55

    Re: Formula macro

    Quote Originally Posted by daffodil11 View Post
    Please Login or Register  to view this content.
    Hi

    Thank you for this. However, when I run, I get the folllowing error:

    "Object doesn't support this property or method"

    When I debut it highlights

    ws.Range("N1:AG3000").ArrayFormula = Sheets("Parameters").Range("N1:AG3000").ArrayFormula
    Any help please?

    Thank you!

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Formula macro

    Coping array formulas is a little tricky. Try shg's suggested solution from here
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  6. #6
    Registered User
    Join Date
    04-22-2013
    Location
    Philippines & Australia
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    73

    Re: Formula macro

    Try This method

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Formula macro

    Change the whole macro by
    Please Login or Register  to view this content.
    Last edited by kvsrinivasamurthy; 07-31-2015 at 03:18 AM.

+ 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: 0
    Last Post: 02-25-2015, 04:16 PM
  2. VBA Macro: Plugging an Array-Formula into a Cell and Dragging Formula Down Columns
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2013, 02:57 PM
  3. Replies: 1
    Last Post: 01-27-2013, 11:05 AM
  4. Need Excel formula in Macro using Subtotal formula with If function
    By mbnewton1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2013, 03:00 PM
  5. Macro: Applying formula to multiple cells in excel (formula editing)
    By city in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2012, 06:41 AM
  6. Formula/macro - Apply certain formula as per duplicate cells in column L
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2011, 12:28 AM
  7. Formula expected end of statement error, typing formula into cell as part of VBA macro
    By DavidGMullins@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2006, 03:05 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