+ Reply to Thread
Results 1 to 5 of 5

Syntax Correction: Combine text with variable

  1. #1
    Registered User
    Join Date
    04-15-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Syntax Correction: Combine text with variable

    I have the following VBA code and try to sum the range from B2 to CY2 for DA2; then B3 to CY3 for DA3, etc. Therefore I use the for loop. It results in "Application defined or Object defined error".

    Could anybody help me to correct the syntax?

    -----------------------------------------------------------------------
    Please Login or Register  to view this content.
    Last edited by cazooo; 05-08-2009 at 08:46 PM. Reason: Put code fragment in code tag

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Syntax Correction

    Please read the forum rules, and then edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Syntax Correction: Combine text with variable

    Thanks.

    This may fix the first line; I'm not sure what you're tring to do with the second.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-15-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Syntax Correction: Combine text with variable

    Thank you, it's solved. Actually it should have Range in between to sum from cell B2 to cell CY2 and the result should be pasted to cell CZ2 as shown in the code.
    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Syntax Correction: Combine text with variable

    I question whether you don't want the average instead of the sum over a constant, which is subject to error.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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