Results 1 to 5 of 5

Syntax Correction: Combine text with variable

Threaded View

cazooo Syntax Correction: Combine... 05-08-2009, 04:44 PM
shg Re: Syntax Correction 05-08-2009, 04:47 PM
shg Re: Syntax Correction:... 05-08-2009, 08:33 PM
cazooo Re: Syntax Correction:... 05-08-2009, 08:44 PM
shg Re: Syntax Correction:... 05-08-2009, 10:36 PM
  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?

    -----------------------------------------------------------------------
    Sub CalculatePhi()
    For i = 2 To 103
        Cells(i, 104) = Application.WorksheetFunction.Sum(Range("B &i& ", "CY &i& ")) / 101
        Cells(104, i + 1) = Application.WorksheetFunction.Sum(Range(Cells(i + 1, 2), Cells(i + 1, 103))) / 101
    Next i
    End Sub
    Last edited by cazooo; 05-08-2009 at 08:46 PM. Reason: Put code fragment in code tag

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