For those who responded - Thanks! I got it :-) Here is what I ended up doing:
ls_gas, ls_gasohol, ls_sum_tot_gas are global variables
Function calc_gallons()
Dim i, j As Integer
Dim total_gal As Integer
For i = 1 To 17
ls_gas = CInt(tbl_worksheet1.Rows(i).Cells(1).Text)
ls_gasohol = CInt(tbl_worksheet1.Rows(i).Cells(2).Text)
total_gal = CInt(ls_gas) + CInt(ls_gasohol)
tbl_worksheet1.Rows(i).Cells(3).Text() = total_gal
Next
tbl_worksheet1.Rows(i).Cells(3).Text() = total_gal
For j = 1 To 17
ls_tot_gal = CInt(ls_gas) + CInt(ls_gasohol)
ls_sum_tot_gas = ls_sum_tot_gas + CInt(ls_tot_gal)
Next j
tbl_worksheet1.Rows(18).Cells(3).Text() = ls_sum_tot_gas
End Function
This works exactly as I needed it to - told you I'm terrible at for/next loops!
This is actually simple :-) Thanks for all of your help. Coleen
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/