+ Reply to Thread
Results 1 to 2 of 2

VBA formula Property help!

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2013
    Posts
    1

    VBA formula Property help!

    Thanks in Advance! Okay guys, I have spend a whole day trying to figure this thing out but no luck I think I'm done with part 1 and 2, but I have no clue what to do with part 3. I know I'll have to use activecell.formula, but I'm not getting anywhere. I'm attaching the file as well. The questions that I'm trying to solve for my problems are as follows:

    1. The excel has sales totals for 12 months and 10 different products in the range B4:M14, write a VBA sub to enter formulas for the total in column N and row 14. Use R1C1 property to write formula.

    2. Repeat previous exercise, but now assume the data set could change, either by adding more months or adding products, or both. Using Formula R1C1, fill the row below data and the column to the right of the data with formulas for totals. (Hint, use string concatenation)

    3. Do the previous two exercises by using "formula" property, rather than formulaR1C1 property.




    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Leith Ross; 07-26-2013 at 10:18 PM. Reason: Added Code Tags

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

    Re: VBA formula Property help!

    Excel Developer Reference

    Range.Formula Property
    -----------------------------------------
    Returns or sets a Variant value that represents the object's formula in A1-style notation and in the language of the macro.

    Syntax:
    expression.Formula
    expression: A variable that represents a Range object.

    Remarks:
    If the range is a one- or two-dimensional range, you can set the formula to a Visual Basic array of the same dimensions. Similarly, you can put the formula into a Visual Basic array.
    Setting the formula for a multiple-cell range fills all cells in the range with the formula.



    Example: This example sets the formula for cell A1 on Sheet1.


    Worksheets("Sheet1").Range("A1").Formula = "=$A$4+$A$10"
    Last edited by protonLeah; 07-26-2013 at 09:03 PM.
    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)

Similar Threads

  1. [SOLVED] User form - Can't set ControlSource property. Invalid property value.
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-26-2013, 05:29 AM
  2. [SOLVED] Excel run-time error '381': Could not set the List property. Invalid property array index
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2012, 12:48 PM
  3. Replies: 2
    Last Post: 06-11-2012, 03:03 PM
  4. Understanding Cells property vs. Offset property (implicit vs explicit references)
    By Wedge120 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-26-2010, 10:38 PM
  5. Runtime Error 380 – Could not set the list property. Invalid property value
    By BernzG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2005, 05:10 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