+ Reply to Thread
Results 1 to 2 of 2

Totals/Sum in Excel?

  1. #1
    Rich
    Guest

    Totals/Sum in Excel?

    I have 2 tabs going.

    Data Tab
    Column C = Branch (1-70) Each branch has 6 records.
    Column N = Off Schedule (1's and 0's : yes or no field from Access)

    Overview Tab
    Column C = Branch
    Column E = Status Lists out each Branch (1-70) and should display
    either "On Schedule" or "Off Schedule"


    Code below is Looping through each Data Tab Branch record (6 each)
    looking for 1's and 0's in column N.
    ..
    If greater then 0 (Overview)Column E should display "Off Schedule"
    If = 0 (Overview)Column E should display "On Schedule"

    Not working?

    Private Sub CommandButton1_Click()


    Dim x As Integer
    Dim y As Integer
    Dim rn As Integer
    Dim rnData As Integer
    Dim rnOverview As Integer

    Do While x = 0
    y = 0
    rnOverview = 4
    rnData = 4
    Do While y = 0
    If (Worksheets("Overview").Range("C" & rnOverview).Value =
    Worksheets("Data").Range("C" & rnData).Value) And
    Worksheets("Data").Range("N" & rnData).Value > 0 Then
    Worksheets("Overview").Range("E" & rnOverview).Value =
    "Off Schedule"
    Else
    Worksheets("Overview").Range("E" &
    rnOverview).Value = "On Schedule"

    y = 1
    End If
    rnData = rnData + 1
    If Worksheets("Data").Range("A" & rnData).Value = "" Then y
    = 1
    Loop
    rnOverview = rnOverview + 1
    If Worksheets("Overview").Range("B" & rnOverview).Value = ""
    Then x = 1
    Loop
    End Sub


  2. #2
    Don Guillett
    Guest

    Re: Totals/Sum in Excel?

    try
    Sub doloopd()
    mlr = Cells(Rows.Count, "h").End(xlUp).Row
    For i = 1 To mlr
    Select Case Cells(i, "h")
    Case " ": x = ""
    Case 0: x = "Zero"
    Case 1: x = "One"
    Case Else
    End Select
    Cells(i, "H").Offset(, 1) = x
    Next i
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Rich" <[email protected]> wrote in message
    news:[email protected]...
    >I have 2 tabs going.
    >
    > Data Tab
    > Column C = Branch (1-70) Each branch has 6 records.
    > Column N = Off Schedule (1's and 0's : yes or no field from Access)
    >
    > Overview Tab
    > Column C = Branch
    > Column E = Status Lists out each Branch (1-70) and should display
    > either "On Schedule" or "Off Schedule"
    >
    >
    > Code below is Looping through each Data Tab Branch record (6 each)
    > looking for 1's and 0's in column N.
    > .
    > If greater then 0 (Overview)Column E should display "Off Schedule"
    > If = 0 (Overview)Column E should display "On Schedule"
    >
    > Not working?
    >
    > Private Sub CommandButton1_Click()
    >
    >
    > Dim x As Integer
    > Dim y As Integer
    > Dim rn As Integer
    > Dim rnData As Integer
    > Dim rnOverview As Integer
    >
    > Do While x = 0
    > y = 0
    > rnOverview = 4
    > rnData = 4
    > Do While y = 0
    > If (Worksheets("Overview").Range("C" & rnOverview).Value =
    > Worksheets("Data").Range("C" & rnData).Value) And
    > Worksheets("Data").Range("N" & rnData).Value > 0 Then
    > Worksheets("Overview").Range("E" & rnOverview).Value =
    > "Off Schedule"
    > Else
    > Worksheets("Overview").Range("E" &
    > rnOverview).Value = "On Schedule"
    >
    > y = 1
    > End If
    > rnData = rnData + 1
    > If Worksheets("Data").Range("A" & rnData).Value = "" Then y
    > = 1
    > Loop
    > rnOverview = rnOverview + 1
    > If Worksheets("Overview").Range("B" & rnOverview).Value = ""
    > Then x = 1
    > Loop
    > End Sub
    >




+ 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