|
-
Apr 29th, 2013, 03:20 AM
#1
Thread Starter
New Member
Adding Files to DataGridView then exporting it into excel.
Hi I just finished my firs program and now I want to upgrade it. I need the program to take info from the text inserted and calculated and transfer it to a DataGridView. From there all the items in the DataGridView should be transferred to a excel document.
This is the code fro my program:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim num1, num2, num3, num4, num5, num6, num7, num8, product As Single, weight As Single, quantity As Single, total As Single
num1 = TextBox1.Text
num2 = TextBox2.Text
num3 = TextBox3.Text
num4 = TextBox4.Text
num5 = TextBox5.Text
num6 = Val(8.3)
num7 = Val(1000000)
num8 = Val(7.85)
weight = num1 * num2 * num3 * num8 / num7
product = num1 * num2 * num3 * num4 * num6 / num7
total = quantity * product
quantity = product * num5
MaskedTextBox1.Text = weight
MaskedTextBox2.Text = product
MaskedTextBox3.Text = quantity
MaskedTextBox1.Text = CStr(weight) + " kg"
Now when you click button 2 it should send the data too the DataGridView.
The data should be in this format:
Quantity(textbox5) Length(textbox1) x(just an x) Width(textbox2) x Thickness (textbox3) R(Currency in rand)product (maskedTextbox2) R Total(MaskedTextbox3). This Should Look Like This:
10 300x200x12 R74.70 R747.00
Then once all the items are there they should be transferred to an excel sheet in almost the same sequence.
10 300 300 12 R74.70 R747.00
Any help would be appreciated as I know basically nothing about coding.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|