473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Loading data into a datatable - got it!

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/
Nov 20 '05 #1
0 782

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: kids_pro | last post by:
I had come across a code block from Loading a DataSet from XML (.NET Framework Developer's Guide) ---------------------------------------- NOte If you call ReadXML to load a very large file, you...
3
by: Steve Richter | last post by:
here is an error I get when I open my class library project: "The class ResultsTable can be designed, but is not the first class in the file. Visual Studio requires that designers use the first...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
0
by: Terry Olsen | last post by:
I wrote the following code to load a DataTable with a CSV file. My problem is: If I include the line "MyTable.Clear()" before I start loading the Table, I'm presented with the 2nd line of my CSV...
4
by: Fred Nelson | last post by:
I have an applicatioin that I'm writing that uses a "case" file that contains over 350 columns and more may be added in the future. I would like to create a dataset with all the column names and...
4
by: Tim Marsden | last post by:
Hi, I want to display the contents of a table in a datagrid. However I don't want to load all the rows before presenting it to the user. Is there a way I can load the datagrid a page at a time,...
3
by: P K | last post by:
Hello, I have a dataset which is already loaded with data in one table. so dataset.tables("data") exists and has data. Now, I have to add another table to the dataset. The source for this...
7
by: koonda | last post by:
Hi guys, I am trying to create a web interface in C# using ASP.NET. The database being used is SQL Server. I have some problems loading the tables in the datalist controls. When I run the program...
0
by: Chris | last post by:
Hello, I have a problem with re-loading datasets. As a simple example, if I have an SQL table of addresses comprising active and inactive addresss, I wish to load either sub-set by clicking on...
7
by: Rotsey | last post by:
Hi, I am loading a tab control on a form. The code loads textboxes and comboboxes and checkboxes, normal data entry form that loads a table row of data. I have a combo on the form above the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.