+ Reply to Thread
Results 1 to 3 of 3

Totals

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Here's a simplified version of your code.
    You can use one SumString and just add it to itself repeatedly.

    Sub Totals()
    
    Dim Start As String
    Dim EndPart As String
    Dim Spacer As Integer
    Dim SumString As String
    Dim Argument As Integer
    Dim Counter As Integer
    Dim Num As Integer
    
    Spacer = 4
    Start = "R[-"
    EndPart = "]C"
    Argument = Spacer
    Num = InputBox("How many portfolio companies are there? ")
    SumString = "=R[-4]C"
    For Counter = 2 To Num
        Argument = Counter * Spacer
        SumString = SumString & "+" & Start & Argument & EndPart
    Next Counter
    MsgBox ("Here: " & SumString)
    End Sub
    HTH

  2. #2
    Registered User
    Join Date
    06-13-2005
    Posts
    21
    bhofsetz,

    You're awesome!

    Thanks,

    Peter

+ 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