LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Rich
 
Posts: n/a
Default 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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Open Excel 2003 from Windows Explorer pmpjr Excel Discussion (Misc queries) 9 September 11th 06 03:58 PM
Need suggestions for some uses of Ms Excel Bible John Excel Discussion (Misc queries) 1 February 27th 06 05:30 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Excel 2002 and 2000 co-install. Control Which Starts ? cnuk Excel Discussion (Misc queries) 2 January 17th 05 08:07 PM


All times are GMT +1. The time now is 12:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"