Results 1 to 10 of 10

Range Syntax

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-03-2009
    Location
    Cary, NC
    MS-Off Ver
    Excel 2016
    Posts
    109

    Range Syntax

    What is the correct syntax to make this line of code work:

    .Cells(2, CtrLastColumn).FormulaR1C1 = Application.WorksheetFunction.Sum(.Range("B2:" & CtrLastColumn & "2"))
    CtrLastColumn is defined as

    Dim CtrLastColumn As Integer
    As it is it's giving me an Application-defined or Object-defined error. It is in a With Sheets block.
    Last edited by bishoposiris; 02-28-2014 at 12:15 PM. Reason: Solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Syntax to set range
    By marlonsaveri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2011, 01:48 PM
  2. Replies: 2
    Last Post: 06-24-2010, 11:44 PM
  3. Syntax of Range
    By avveerkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2007, 01:46 PM
  4. Syntax help with range
    By ZZBC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2006, 03:35 AM
  5. Range syntax
    By Dr.Schwartz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2005, 09:05 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