+ Reply to Thread
Results 1 to 2 of 2

Help with Consoldate Syntax

  1. #1
    Registered User
    Join Date
    09-07-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    27

    Help with Consoldate Syntax

    I'm trying to consolidate data that has a Time and a Number. The time is sometimes repeated so I would like to just add the numbers with the repeated time and the non-duplicate time vs number table.

    I've done this successfully, manually, using the Consolidate window in Excel.

    Then I've done it successfully, using excel and the code:

    Range("I2").Select
    Selection.Consolidate Sources:=("R2C6:R20C7"), Function:=xlSum, TopRow:=False, LeftColumn:=True, CreateLinks:=False

    This will create the table in I2.


    My Questions:

    1) The R2C6:R20C7 length is varied. The top left will always start in R2,C6 but the number if columns it will go down will vary. I tried hardcoding in 9999999 but then it just takes excel forever to do the consolidation. How do I tell it to goto the last column with a number inside it?

    2) more generally, why does this use a R C notation? I tried like F2:G10 and it errored out. I thought it was kinda confusing that I had to use R C.

    Thanks for any help.

  2. #2
    Registered User
    Join Date
    09-07-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Help with Consoldate Syntax

    I got It.

    I used

    LastRow 0 = Range("F" & Rows.Count).End(xlUp).Row
    Range("I2").Select
    Selection.Consolidate Sources:=("R2C6:R" & lastRow0 & "C7"), Function:=xlSum, TopRow:=False, LeftColumn:=True, CreateLinks:=False

+ 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] really need help with IF syntax.... :-\
    By MissO in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-09-2014, 04:10 PM
  2. Need syntax
    By jaganexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2013, 09:06 AM
  3. 'If' syntax
    By hvisa in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-30-2007, 04:33 PM
  4. [SOLVED] If then syntax
    By RL in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 12:05 PM
  5. Syntax help!
    By Mike Fogleman in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-30-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